ADB: Minor fix, autopoll list could be lost on a failed bus reset

parent 79d09548
...@@ -83,6 +83,7 @@ static pid_t adb_probe_task_pid; ...@@ -83,6 +83,7 @@ static pid_t adb_probe_task_pid;
static DECLARE_MUTEX(adb_probe_mutex); static DECLARE_MUTEX(adb_probe_mutex);
static struct completion adb_probe_task_comp; static struct completion adb_probe_task_comp;
static int sleepy_trackpad; static int sleepy_trackpad;
static int autopoll_devs;
int __adb_probe_sync; int __adb_probe_sync;
#ifdef CONFIG_PMAC_PBOOK #ifdef CONFIG_PMAC_PBOOK
...@@ -379,7 +380,7 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when) ...@@ -379,7 +380,7 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
static int static int
do_adb_reset_bus(void) do_adb_reset_bus(void)
{ {
int ret, nret, devs; int ret, nret;
if (adb_controller == NULL) if (adb_controller == NULL)
return -ENXIO; return -ENXIO;
...@@ -390,7 +391,7 @@ do_adb_reset_bus(void) ...@@ -390,7 +391,7 @@ do_adb_reset_bus(void)
nret = notifier_call_chain(&adb_client_list, ADB_MSG_PRE_RESET, NULL); nret = notifier_call_chain(&adb_client_list, ADB_MSG_PRE_RESET, NULL);
if (nret & NOTIFY_STOP_MASK) { if (nret & NOTIFY_STOP_MASK) {
if (adb_controller->autopoll) if (adb_controller->autopoll)
adb_controller->autopoll(devs); adb_controller->autopoll(autopoll_devs);
return -EBUSY; return -EBUSY;
} }
...@@ -416,9 +417,9 @@ do_adb_reset_bus(void) ...@@ -416,9 +417,9 @@ do_adb_reset_bus(void)
} }
if (!ret) { if (!ret) {
devs = adb_scan_bus(); autopoll_devs = adb_scan_bus();
if (adb_controller->autopoll) if (adb_controller->autopoll)
adb_controller->autopoll(devs); adb_controller->autopoll(autopoll_devs);
} }
up(&adb_handler_sem); up(&adb_handler_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment