diff options
author | Shaohua Li <shaohua.li@intel.com> | 2008-08-28 10:04:29 +0800 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-09-23 23:04:43 -0400 |
commit | 6bd00a61ab63d4ceb635ae0316353c11c900b8d8 (patch) | |
tree | 249e417279df1448f1ad43c135c22990b5dde2cb /drivers/acpi/bus.c | |
parent | db350b084dc2cf816288643861ce07b0562dd723 (diff) | |
download | lwn-6bd00a61ab63d4ceb635ae0316353c11c900b8d8.tar.gz lwn-6bd00a61ab63d4ceb635ae0316353c11c900b8d8.zip |
ACPI: introduce notifier change to avoid duplicates
The battery driver already registers notification handler.
To avoid registering notification handler again,
introduce a notifier chain in global system notifier handler
and use it in dock driver.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index ccae305ee55d..0dc44945725e 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -496,6 +496,19 @@ static int acpi_bus_check_scope(struct acpi_device *device) return 0; } +static BLOCKING_NOTIFIER_HEAD(acpi_bus_notify_list); +int register_acpi_bus_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_register(&acpi_bus_notify_list, nb); +} +EXPORT_SYMBOL_GPL(register_acpi_bus_notifier); + +void unregister_acpi_bus_notifier(struct notifier_block *nb) +{ + blocking_notifier_chain_unregister(&acpi_bus_notify_list, nb); +} +EXPORT_SYMBOL_GPL(unregister_acpi_bus_notifier); + /** * acpi_bus_notify * --------------- @@ -506,6 +519,8 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) int result = 0; struct acpi_device *device = NULL; + blocking_notifier_call_chain(&acpi_bus_notify_list, + type, (void *)handle); if (acpi_bus_get_device(handle, &device)) return; |