aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acpi_bus.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-20 18:36:49 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-03 07:09:40 -0500
commit0cd6ac52b333f66ee64e50ed216ec99231092dcd (patch)
tree6172c3977fe7d5ea3a9c04312ff19c3be28929a6 /include/acpi/acpi_bus.h
parent209d3b1743c8187c67cc75dbe9fefbcd3121fba0 (diff)
ACPI: Make acpi_bus_scan() and acpi_bus_add() take only one argument
The callers of acpi_bus_add() usually assume that if it has succeeded, then a struct acpi_device object has been attached to the handle passed as the first argument. Unfortunately, however, this assumption is wrong, because acpi_bus_scan(), and acpi_bus_add() too as a result, may return a pointer to a different struct acpi_device object on success (it may be an object corresponding to one of the descendant ACPI nodes in the namespace scope below that handle). For this reason, the callers of acpi_bus_add() who care about whether or not a struct acpi_device object has been created for its first argument need to check that using acpi_bus_get_device() anyway, so the second argument of acpi_bus_add() is not really useful for them. The same observation applies to acpi_bus_scan() executed directly from acpi_scan_init(). Therefore modify the relevant callers of acpi_bus_add() to check the existence of the struct acpi_device in question with the help of acpi_bus_get_device() and drop the no longer necessary second argument of acpi_bus_add(). Accordingly, modify acpi_scan_init() to use acpi_bus_get_device() to get acpi_root and drop the no longer needed second argument of acpi_bus_scan(). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'include/acpi/acpi_bus.h')
-rw-r--r--include/acpi/acpi_bus.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 056cb0cd8eff..5e1d5a1b477f 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -351,7 +351,7 @@ static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 ty
351#endif 351#endif
352int acpi_bus_register_driver(struct acpi_driver *driver); 352int acpi_bus_register_driver(struct acpi_driver *driver);
353void acpi_bus_unregister_driver(struct acpi_driver *driver); 353void acpi_bus_unregister_driver(struct acpi_driver *driver);
354int acpi_bus_add(acpi_handle handle, struct acpi_device **ret); 354int acpi_bus_add(acpi_handle handle);
355void acpi_bus_hot_remove_device(void *context); 355void acpi_bus_hot_remove_device(void *context);
356int acpi_bus_trim(struct acpi_device *start, int rmdevice); 356int acpi_bus_trim(struct acpi_device *start, int rmdevice);
357acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); 357acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);