mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-09 04:12:08 -05:00
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
ad81f0545e
commit
f22ff5523a
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue