]> git.neil.brown.name Git - history.git/commitdiff
ADB: Minor fix, autopoll list could be lost on a failed bus reset
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 6 Feb 2004 03:52:16 +0000 (14:52 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 6 Feb 2004 03:52:16 +0000 (14:52 +1100)
drivers/macintosh/adb.c

index a20a9e899ef400d58bd20a90ce2e1a8df8b4ea84..f1d34776308e176a4126bc6ed7cd2bfc583aa81f 100644 (file)
@@ -83,6 +83,7 @@ static pid_t adb_probe_task_pid;
 static DECLARE_MUTEX(adb_probe_mutex);
 static struct completion adb_probe_task_comp;
 static int sleepy_trackpad;
+static int autopoll_devs;
 int __adb_probe_sync;
 
 #ifdef CONFIG_PMAC_PBOOK
@@ -379,7 +380,7 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
 static int
 do_adb_reset_bus(void)
 {
-       int ret, nret, devs;
+       int ret, nret;
        
        if (adb_controller == NULL)
                return -ENXIO;
@@ -390,7 +391,7 @@ do_adb_reset_bus(void)
        nret = notifier_call_chain(&adb_client_list, ADB_MSG_PRE_RESET, NULL);
        if (nret & NOTIFY_STOP_MASK) {
                if (adb_controller->autopoll)
-                       adb_controller->autopoll(devs);
+                       adb_controller->autopoll(autopoll_devs);
                return -EBUSY;
        }
 
@@ -416,9 +417,9 @@ do_adb_reset_bus(void)
        }
 
        if (!ret) {
-               devs = adb_scan_bus();
+               autopoll_devs = adb_scan_bus();
                if (adb_controller->autopoll)
-                       adb_controller->autopoll(devs);
+                       adb_controller->autopoll(autopoll_devs);
        }
        up(&adb_handler_sem);