ACPI / dock: Rework the handling of notifications
commit59401ccce8729e5c43f9781cc5570da5ca470e27
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 30 Jun 2013 21:48:49 +0000 (30 23:48 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 14 Jul 2013 23:33:11 +0000 (15 01:33 +0200)
tree89df37b34421898ea83163c942af31318039f99e
parent4ec24065a65b4debfdeb591cc01a4aa092651f53
ACPI / dock: Rework the handling of notifications

The ACPI dock driver uses register_acpi_bus_notifier() which
installs a notifier triggered globally for all system notifications.
That first of all is inefficient, because the dock driver is only
interested in notifications associated with the devices it handles,
but it has to handle all system notifies for all devices.  Moreover,
it does that even if no docking stations are present in the system
(CONFIG_ACPI_DOCK set is sufficient for that to happen).  Besides,
that is inconvenient, because it requires the driver to do extra work
for each notification to find the target dock station object.

For these reasons, rework the dock driver to install a notify
handler individually for each dock station in the system using
acpi_install_notify_handler().  This allows the dock station
object to be passed directly to the notify handler and makes it
possible to simplify the dock driver quite a bit.  It also
reduces the overhead related to the handling of all system
notifies when CONFIG_ACPI_DOCK is set.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
drivers/acpi/dock.c