From 8dc9760b425ac3b44ec5ddc3ee3ad149a2bca659 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Thu, 28 Aug 2008 10:07:14 +0800 Subject: [PATCH] --- yaml --- r: 117347 b: refs/heads/master c: 61b836958371c717d1e6d4fea1d2c512969ad20b h: refs/heads/master i: 117345: 58e8220bfe8b55ed8c6fc9678f2583db1e57cdeb 117343: 43243c512cf8d9b1dc3362c30668f865de6ed3ab v: v3 --- [refs] | 2 +- trunk/drivers/acpi/dock.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 53302f1183b7..13cc24039bd8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4be9309d15e88e4a1e4a78deb52eb88c7da38c99 +refs/heads/master: 61b836958371c717d1e6d4fea1d2c512969ad20b diff --git a/trunk/drivers/acpi/dock.c b/trunk/drivers/acpi/dock.c index ac7dfefcb50b..c877cc526002 100644 --- a/trunk/drivers/acpi/dock.c +++ b/trunk/drivers/acpi/dock.c @@ -609,6 +609,7 @@ register_hotplug_dock_device(acpi_handle handle, struct acpi_dock_ops *ops, { struct dock_dependent_device *dd; struct dock_station *dock_station; + int ret = -EINVAL; if (!dock_station_count) return -ENODEV; @@ -618,16 +619,21 @@ register_hotplug_dock_device(acpi_handle handle, struct acpi_dock_ops *ops, * this would include the dock station itself */ list_for_each_entry(dock_station, &dock_stations, sibiling) { + /* + * An ATA bay can be in a dock and itself can be ejected + * seperately, so there are two 'dock stations' which need the + * ops + */ dd = find_dock_dependent_device(dock_station, handle); if (dd) { dd->ops = ops; dd->context = context; dock_add_hotplug_device(dock_station, dd); - return 0; + ret = 0; } } - return -EINVAL; + return ret; } EXPORT_SYMBOL_GPL(register_hotplug_dock_device); @@ -1078,8 +1084,8 @@ find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) static acpi_status find_bay(acpi_handle handle, u32 lvl, void *context, void **rv) { - /* If bay is in a dock, it's already handled */ - if (is_ejectable_bay(handle) && !is_dock_device(handle)) + /* If bay is a dock, it's already handled */ + if (is_ejectable_bay(handle) && !is_dock(handle)) dock_add(handle); return AE_OK; }