diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2018-11-09 15:21:35 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-11-26 18:19:11 +0100 |
commit | 7847a1455fc4574d53e349d60feb1e1106cdc012 (patch) | |
tree | a83039d4fa290580b01760aec3aa48b5f0f8e2ab /drivers/acpi | |
parent | drivers core: Prepare support for multiple platform notifications (diff) | |
download | linux-7847a1455fc4574d53e349d60feb1e1106cdc012.tar.xz linux-7847a1455fc4574d53e349d60feb1e1106cdc012.zip |
ACPI / glue: Add acpi_platform_notify() function
Instead of relying on the "platform_notify" callback hook,
introducing separate notification function
acpi_platform_notify() and calling that directly from
drivers core when device entries are added and removed.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/bus.c | 1 | ||||
-rw-r--r-- | drivers/acpi/glue.c | 21 | ||||
-rw-r--r-- | drivers/acpi/internal.h | 1 |
3 files changed, 13 insertions, 10 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index bb3d96dea6db..99d820a693a8 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -1237,7 +1237,6 @@ static int __init acpi_init(void) acpi_kobj = NULL; } - init_acpi_device_notify(); result = acpi_bus_init(); if (result) { disable_acpi(); diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 12ba2bee8789..edd10b3c7ec8 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -296,7 +296,7 @@ int acpi_unbind_one(struct device *dev) } EXPORT_SYMBOL_GPL(acpi_unbind_one); -static int acpi_platform_notify(struct device *dev) +static int acpi_device_notify(struct device *dev) { struct acpi_bus_type *type = acpi_get_bus_type(dev); struct acpi_device *adev; @@ -343,7 +343,7 @@ static int acpi_platform_notify(struct device *dev) return ret; } -static int acpi_platform_notify_remove(struct device *dev) +static int acpi_device_notify_remove(struct device *dev) { struct acpi_device *adev = ACPI_COMPANION(dev); struct acpi_bus_type *type; @@ -361,12 +361,17 @@ static int acpi_platform_notify_remove(struct device *dev) return 0; } -void __init init_acpi_device_notify(void) +int acpi_platform_notify(struct device *dev, enum kobject_action action) { - if (platform_notify || platform_notify_remove) { - printk(KERN_ERR PREFIX "Can't use platform_notify\n"); - return; + switch (action) { + case KOBJ_ADD: + acpi_device_notify(dev); + break; + case KOBJ_REMOVE: + acpi_device_notify_remove(dev); + break; + default: + break; } - platform_notify = acpi_platform_notify; - platform_notify_remove = acpi_platform_notify_remove; + return 0; } diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 530a3f675490..83a7dfb7d1cf 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -23,7 +23,6 @@ int early_acpi_osi_init(void); int acpi_osi_init(void); acpi_status acpi_os_initialize1(void); -void init_acpi_device_notify(void); int acpi_scan_init(void); void acpi_pci_root_init(void); void acpi_pci_link_init(void); |