diff options
| -rw-r--r-- | drivers/acpi/bus.c | 1 | ||||
| -rw-r--r-- | drivers/acpi/glue.c | 21 | ||||
| -rw-r--r-- | drivers/acpi/internal.h | 1 | ||||
| -rw-r--r-- | drivers/base/core.c | 7 | ||||
| -rw-r--r-- | include/linux/acpi.h | 10 |
5 files changed, 30 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) | |||
| 1237 | acpi_kobj = NULL; | 1237 | acpi_kobj = NULL; |
| 1238 | } | 1238 | } |
| 1239 | 1239 | ||
| 1240 | init_acpi_device_notify(); | ||
| 1241 | result = acpi_bus_init(); | 1240 | result = acpi_bus_init(); |
| 1242 | if (result) { | 1241 | if (result) { |
| 1243 | disable_acpi(); | 1242 | 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) | |||
| 296 | } | 296 | } |
| 297 | EXPORT_SYMBOL_GPL(acpi_unbind_one); | 297 | EXPORT_SYMBOL_GPL(acpi_unbind_one); |
| 298 | 298 | ||
| 299 | static int acpi_platform_notify(struct device *dev) | 299 | static int acpi_device_notify(struct device *dev) |
| 300 | { | 300 | { |
| 301 | struct acpi_bus_type *type = acpi_get_bus_type(dev); | 301 | struct acpi_bus_type *type = acpi_get_bus_type(dev); |
| 302 | struct acpi_device *adev; | 302 | struct acpi_device *adev; |
| @@ -343,7 +343,7 @@ static int acpi_platform_notify(struct device *dev) | |||
| 343 | return ret; | 343 | return ret; |
| 344 | } | 344 | } |
| 345 | 345 | ||
| 346 | static int acpi_platform_notify_remove(struct device *dev) | 346 | static int acpi_device_notify_remove(struct device *dev) |
| 347 | { | 347 | { |
| 348 | struct acpi_device *adev = ACPI_COMPANION(dev); | 348 | struct acpi_device *adev = ACPI_COMPANION(dev); |
| 349 | struct acpi_bus_type *type; | 349 | struct acpi_bus_type *type; |
| @@ -361,12 +361,17 @@ static int acpi_platform_notify_remove(struct device *dev) | |||
| 361 | return 0; | 361 | return 0; |
| 362 | } | 362 | } |
| 363 | 363 | ||
| 364 | void __init init_acpi_device_notify(void) | 364 | int acpi_platform_notify(struct device *dev, enum kobject_action action) |
| 365 | { | 365 | { |
| 366 | if (platform_notify || platform_notify_remove) { | 366 | switch (action) { |
| 367 | printk(KERN_ERR PREFIX "Can't use platform_notify\n"); | 367 | case KOBJ_ADD: |
| 368 | return; | 368 | acpi_device_notify(dev); |
| 369 | break; | ||
| 370 | case KOBJ_REMOVE: | ||
| 371 | acpi_device_notify_remove(dev); | ||
| 372 | break; | ||
| 373 | default: | ||
| 374 | break; | ||
| 369 | } | 375 | } |
| 370 | platform_notify = acpi_platform_notify; | 376 | return 0; |
| 371 | platform_notify_remove = acpi_platform_notify_remove; | ||
| 372 | } | 377 | } |
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 @@ | |||
| 23 | int early_acpi_osi_init(void); | 23 | int early_acpi_osi_init(void); |
| 24 | int acpi_osi_init(void); | 24 | int acpi_osi_init(void); |
| 25 | acpi_status acpi_os_initialize1(void); | 25 | acpi_status acpi_os_initialize1(void); |
| 26 | void init_acpi_device_notify(void); | ||
| 27 | int acpi_scan_init(void); | 26 | int acpi_scan_init(void); |
| 28 | void acpi_pci_root_init(void); | 27 | void acpi_pci_root_init(void); |
| 29 | void acpi_pci_link_init(void); | 28 | void acpi_pci_link_init(void); |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 3972ef3f080b..260cbdf44f1d 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * Copyright (c) 2006 Novell, Inc. | 8 | * Copyright (c) 2006 Novell, Inc. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/acpi.h> | ||
| 11 | #include <linux/device.h> | 12 | #include <linux/device.h> |
| 12 | #include <linux/err.h> | 13 | #include <linux/err.h> |
| 13 | #include <linux/fwnode.h> | 14 | #include <linux/fwnode.h> |
| @@ -731,6 +732,12 @@ static inline int device_is_not_partition(struct device *dev) | |||
| 731 | static int | 732 | static int |
| 732 | device_platform_notify(struct device *dev, enum kobject_action action) | 733 | device_platform_notify(struct device *dev, enum kobject_action action) |
| 733 | { | 734 | { |
| 735 | int ret; | ||
| 736 | |||
| 737 | ret = acpi_platform_notify(dev, action); | ||
| 738 | if (ret) | ||
| 739 | return ret; | ||
| 740 | |||
| 734 | if (platform_notify && action == KOBJ_ADD) | 741 | if (platform_notify && action == KOBJ_ADD) |
| 735 | platform_notify(dev); | 742 | platform_notify(dev); |
| 736 | else if (platform_notify_remove && action == KOBJ_REMOVE) | 743 | else if (platform_notify_remove && action == KOBJ_REMOVE) |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ed80f147bd50..4ba2e2d24676 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -1313,4 +1313,14 @@ static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level) | |||
| 1313 | } | 1313 | } |
| 1314 | #endif | 1314 | #endif |
| 1315 | 1315 | ||
| 1316 | #ifdef CONFIG_ACPI | ||
| 1317 | extern int acpi_platform_notify(struct device *dev, enum kobject_action action); | ||
| 1318 | #else | ||
| 1319 | static inline int | ||
| 1320 | acpi_platform_notify(struct device *dev, enum kobject_action action) | ||
| 1321 | { | ||
| 1322 | return 0; | ||
| 1323 | } | ||
| 1324 | #endif | ||
| 1325 | |||
| 1316 | #endif /*_LINUX_ACPI_H*/ | 1326 | #endif /*_LINUX_ACPI_H*/ |
