Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21baf3c7c7fcef5004671f697789aea84854ca45
Commit:     21baf3c7c7fcef5004671f697789aea84854ca45
Parent:     4194db10fab1c9595f12b2846b6799417a8db4dd
Author:     Wim Van Sebroeck <[EMAIL PROTECTED]>
AuthorDate: Sun Jun 3 20:46:05 2007 +0000
Committer:  Wim Van Sebroeck <[EMAIL PROTECTED]>
CommitDate: Sun Jun 3 21:02:17 2007 +0000

    [WATCHDOG] Mixcom Watchdog - checkcard part 2
    
    Convert the mixcom and flashcom card checks to a
    single checkcard call by creating a new structure
    that contains all io-ports and their id's.
    This is part of the port to the isa watchdog device
    driver.
    
    Signed-off-by: Wim Van Sebroeck <[EMAIL PROTECTED]>
---
 drivers/char/watchdog/mixcomwd.c |   44 +++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c
index 17c29cb..0836b9a 100644
--- a/drivers/char/watchdog/mixcomwd.c
+++ b/drivers/char/watchdog/mixcomwd.c
@@ -66,7 +66,34 @@
  */
 #define MIXCOM_ID 0x11
 #define FLASHCOM_ID 0x18
-static int mixcomwd_ioports[] = { 0xd90, 0xe90, 0xf90, 0x000 };
+static struct {
+       int ioport;
+       int id;
+} mixcomwd_io_info[] __devinitdata = {
+       /* The Mixcom cards */
+       {0x0d90, MIXCOM_ID},
+       {0x0e90, MIXCOM_ID},
+       {0x0f90, MIXCOM_ID},
+       /* The FlashCOM cards */
+       {0x0304, FLASHCOM_ID},
+       {0x030c, FLASHCOM_ID},
+       {0x0314, FLASHCOM_ID},
+       {0x031c, FLASHCOM_ID},
+       {0x0324, FLASHCOM_ID},
+       {0x032c, FLASHCOM_ID},
+       {0x0334, FLASHCOM_ID},
+       {0x033c, FLASHCOM_ID},
+       {0x0344, FLASHCOM_ID},
+       {0x034c, FLASHCOM_ID},
+       {0x0354, FLASHCOM_ID},
+       {0x035c, FLASHCOM_ID},
+       {0x0364, FLASHCOM_ID},
+       {0x036c, FLASHCOM_ID},
+       {0x0374, FLASHCOM_ID},
+       {0x037c, FLASHCOM_ID},
+       /* The end of the list */
+       {0x0000, 0},
+};
 
 static void mixcomwd_timerfun(unsigned long d);
 
@@ -242,18 +269,11 @@ static int __init mixcomwd_init(void)
        int ret;
        int found=0;
 
-       for (i = 0; !found && mixcomwd_ioports[i] != 0; i++) {
-               if (checkcard(mixcomwd_ioports[i], MIXCOM_ID)) {
-                       found = 1;
-                       watchdog_port = mixcomwd_ioports[i];
-               }
-       }
-
-       /* The FlashCOM card can be set up at 0x304 -> 0x37c, in 0x8 jumps */
-       for (i = 0x304; !found && i < 0x380; i+=0x8) {
-               if (checkcard(i, FLASHCOM_ID)) {
+       for (i = 0; !found && mixcomwd_io_info[i].ioport != 0; i++) {
+               if (checkcard(mixcomwd_io_info[i].ioport,
+                             mixcomwd_io_info[i].id)) {
                        found = 1;
-                       watchdog_port = i;
+                       watchdog_port = mixcomwd_io_info[i].ioport;
                }
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to