diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2013-06-29 00:24:34 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-15 01:33:09 +0200 |
commit | f22ff5523af8b365167cb79189f8b91470d57c8c (patch) | |
tree | 274b5c3e50516054522ae66f9dc08bf62afa2d71 /drivers/acpi/dock.c | |
parent | ad81f0545ef01ea651886dddac4bef6cec930092 (diff) | |
download | linux-f22ff5523af8b365167cb79189f8b91470d57c8c.tar.bz2 |
ACPI / dock: avoid initializing acpi_dock_notifier_list multiple times
Function dock_add() will be called multiple times if there are
multiple dock stations, which causes acpi_dock_notifier_list to be
initialized multiple times.
To avoid that, move the initialization of acpi_dock_notifier_list
from dock_add() to acpi_dock_init().
[rjw: Changelog]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/dock.c')
-rw-r--r-- | drivers/acpi/dock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 826560753389..c36de862fd50 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -1007,7 +1007,6 @@ static int __init dock_add(acpi_handle handle) mutex_init(&dock_station->hp_lock); spin_lock_init(&dock_station->dd_lock); INIT_LIST_HEAD(&dock_station->sibling); - ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); INIT_LIST_HEAD(&dock_station->dependent_devices); /* we want the dock device to send uevents */ @@ -1078,6 +1077,7 @@ void __init acpi_dock_init(void) return; } + ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); register_acpi_bus_notifier(&dock_acpi_notifier); pr_info(PREFIX "%s: %d docks/bays found\n", ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count); |