diff options
author | Shaohua Li <shaohua.li@intel.com> | 2008-08-27 22:07:14 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-09-23 23:48:52 -0400 |
commit | 61b836958371c717d1e6d4fea1d2c512969ad20b (patch) | |
tree | ef932bf865c7b30b87cdb34b56e4401d11e78c74 /drivers/acpi/dock.c | |
parent | 4be9309d15e88e4a1e4a78deb52eb88c7da38c99 (diff) |
dock: fix for ATA bay in a dock station
an ATA bay can be in a dock and itself can be ejected separately.
This patch handles such eject bay. Found by Holger.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dock.c')
-rw-r--r-- | drivers/acpi/dock.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index ac7dfefcb50b..c877cc526002 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -609,6 +609,7 @@ register_hotplug_dock_device(acpi_handle handle, struct acpi_dock_ops *ops, | |||
609 | { | 609 | { |
610 | struct dock_dependent_device *dd; | 610 | struct dock_dependent_device *dd; |
611 | struct dock_station *dock_station; | 611 | struct dock_station *dock_station; |
612 | int ret = -EINVAL; | ||
612 | 613 | ||
613 | if (!dock_station_count) | 614 | if (!dock_station_count) |
614 | return -ENODEV; | 615 | return -ENODEV; |
@@ -618,16 +619,21 @@ register_hotplug_dock_device(acpi_handle handle, struct acpi_dock_ops *ops, | |||
618 | * this would include the dock station itself | 619 | * this would include the dock station itself |
619 | */ | 620 | */ |
620 | list_for_each_entry(dock_station, &dock_stations, sibiling) { | 621 | list_for_each_entry(dock_station, &dock_stations, sibiling) { |
622 | /* | ||
623 | * An ATA bay can be in a dock and itself can be ejected | ||
624 | * seperately, so there are two 'dock stations' which need the | ||
625 | * ops | ||
626 | */ | ||
621 | dd = find_dock_dependent_device(dock_station, handle); | 627 | dd = find_dock_dependent_device(dock_station, handle); |
622 | if (dd) { | 628 | if (dd) { |
623 | dd->ops = ops; | 629 | dd->ops = ops; |
624 | dd->context = context; | 630 | dd->context = context; |
625 | dock_add_hotplug_device(dock_station, dd); | 631 | dock_add_hotplug_device(dock_station, dd); |
626 | return 0; | 632 | ret = 0; |
627 | } | 633 | } |
628 | } | 634 | } |
629 | 635 | ||
630 | return -EINVAL; | 636 | return ret; |
631 | } | 637 | } |
632 | 638 | ||
633 | EXPORT_SYMBOL_GPL(register_hotplug_dock_device); | 639 | EXPORT_SYMBOL_GPL(register_hotplug_dock_device); |
@@ -1078,8 +1084,8 @@ find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
1078 | static acpi_status | 1084 | static acpi_status |
1079 | find_bay(acpi_handle handle, u32 lvl, void *context, void **rv) | 1085 | find_bay(acpi_handle handle, u32 lvl, void *context, void **rv) |
1080 | { | 1086 | { |
1081 | /* If bay is in a dock, it's already handled */ | 1087 | /* If bay is a dock, it's already handled */ |
1082 | if (is_ejectable_bay(handle) && !is_dock_device(handle)) | 1088 | if (is_ejectable_bay(handle) && !is_dock(handle)) |
1083 | dock_add(handle); | 1089 | dock_add(handle); |
1084 | return AE_OK; | 1090 | return AE_OK; |
1085 | } | 1091 | } |