]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Shaohua Li <shaohua.li@intel.com> |
2 | Subject: fix for bay in a dock station | |
3 | Patch-mainline: submitted 2008-08-28 | |
4 | References: fate#304731,bnc#401740 | |
5 | ||
6 | an ATA bay can be in a dock and itself can be ejected separately. The | |
7 | patch handles such eject bay. Found by Holger. | |
8 | ||
9 | Signed-off-by: Shaohua Li <shaohua.li@intel.com> | |
10 | Signed-off-by: Holger Macht <hmacht@suse.de> | |
11 | --- | |
12 | ||
13 | --- | |
14 | drivers/acpi/dock.c | 14 ++++++++++---- | |
15 | 1 file changed, 10 insertions(+), 4 deletions(-) | |
16 | ||
17 | --- a/drivers/acpi/dock.c | |
18 | +++ b/drivers/acpi/dock.c | |
19 | @@ -609,6 +609,7 @@ register_hotplug_dock_device(acpi_handle | |
20 | { | |
21 | struct dock_dependent_device *dd; | |
22 | struct dock_station *dock_station; | |
23 | + int ret = -EINVAL; | |
24 | ||
25 | if (!dock_station_count) | |
26 | return -ENODEV; | |
27 | @@ -618,16 +619,21 @@ register_hotplug_dock_device(acpi_handle | |
28 | * this would include the dock station itself | |
29 | */ | |
30 | list_for_each_entry(dock_station, &dock_stations, sibiling) { | |
31 | + /* | |
32 | + * An ATA bay can be in a dock and itself can be ejected | |
33 | + * seperately, so there are two 'dock stations' which need the | |
34 | + * ops | |
35 | + */ | |
36 | dd = find_dock_dependent_device(dock_station, handle); | |
37 | if (dd) { | |
38 | dd->ops = ops; | |
39 | dd->context = context; | |
40 | dock_add_hotplug_device(dock_station, dd); | |
41 | - return 0; | |
42 | + ret = 0; | |
43 | } | |
44 | } | |
45 | ||
46 | - return -EINVAL; | |
47 | + return ret; | |
48 | } | |
49 | ||
50 | EXPORT_SYMBOL_GPL(register_hotplug_dock_device); | |
51 | @@ -1076,8 +1082,8 @@ find_dock(acpi_handle handle, u32 lvl, v | |
52 | static acpi_status | |
53 | find_bay(acpi_handle handle, u32 lvl, void *context, void **rv) | |
54 | { | |
55 | - /* If bay is in a dock, it's already handled */ | |
56 | - if (is_ejectable_bay(handle) && !is_dock_device(handle)) | |
57 | + /* If bay is a dock, it's already handled */ | |
58 | + if (is_ejectable_bay(handle) && !is_dock(handle)) | |
59 | dock_add(handle); | |
60 | return AE_OK; | |
61 | } |