diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-25 18:36:44 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-25 18:36:44 -0500 |
| commit | cc38e519132f62d52db0a04d2eaed0d7c52fb165 (patch) | |
| tree | 35baaba355d6fbc1d43e9ca12278156f3eeab910 | |
| parent | 949db153b6466c6f7cad5a427ecea94985927311 (diff) | |
| parent | b8bd759acd05281abf88cddef30c57313c109697 (diff) | |
Merge branch 'acpi-scan' into acpi-cleanup
The following commits depend on the 'acpi-scan' material.
| -rw-r--r-- | drivers/acpi/Makefile | 2 | ||||
| -rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 26 | ||||
| -rw-r--r-- | drivers/acpi/container.c | 31 | ||||
| -rw-r--r-- | drivers/acpi/device_pm.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/dock.c | 17 | ||||
| -rw-r--r-- | drivers/acpi/glue.c | 50 | ||||
| -rw-r--r-- | drivers/acpi/internal.h | 1 | ||||
| -rw-r--r-- | drivers/acpi/pci_bind.c | 122 | ||||
| -rw-r--r-- | drivers/acpi/pci_root.c | 67 | ||||
| -rw-r--r-- | drivers/acpi/processor_driver.c | 32 | ||||
| -rw-r--r-- | drivers/acpi/scan.c | 326 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 44 | ||||
| -rw-r--r-- | drivers/pci/hotplug/sgi_hotplug.c | 10 | ||||
| -rw-r--r-- | drivers/pci/pci-acpi.c | 58 | ||||
| -rw-r--r-- | drivers/pci/pci.c | 26 | ||||
| -rw-r--r-- | drivers/pci/pci.h | 5 | ||||
| -rw-r--r-- | drivers/pci/probe.c | 1 | ||||
| -rw-r--r-- | include/acpi/acpi_bus.h | 25 | ||||
| -rw-r--r-- | include/linux/acpi.h | 5 |
19 files changed, 278 insertions, 572 deletions
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 2a4502becd13..4ee2e753306a 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile | |||
| @@ -37,7 +37,7 @@ acpi-y += resource.o | |||
| 37 | acpi-y += processor_core.o | 37 | acpi-y += processor_core.o |
| 38 | acpi-y += ec.o | 38 | acpi-y += ec.o |
| 39 | acpi-$(CONFIG_ACPI_DOCK) += dock.o | 39 | acpi-$(CONFIG_ACPI_DOCK) += dock.o |
| 40 | acpi-y += pci_root.o pci_link.o pci_irq.o pci_bind.o | 40 | acpi-y += pci_root.o pci_link.o pci_irq.o |
| 41 | acpi-y += acpi_platform.o | 41 | acpi-y += acpi_platform.o |
| 42 | acpi-y += power.o | 42 | acpi-y += power.o |
| 43 | acpi-y += event.o | 43 | acpi-y += event.o |
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index b679bf8478f7..03d18f290118 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
| @@ -157,38 +157,26 @@ static int | |||
| 157 | acpi_memory_get_device(acpi_handle handle, | 157 | acpi_memory_get_device(acpi_handle handle, |
| 158 | struct acpi_memory_device **mem_device) | 158 | struct acpi_memory_device **mem_device) |
| 159 | { | 159 | { |
| 160 | acpi_status status; | ||
| 161 | acpi_handle phandle; | ||
| 162 | struct acpi_device *device = NULL; | 160 | struct acpi_device *device = NULL; |
| 163 | struct acpi_device *pdevice = NULL; | ||
| 164 | int result; | 161 | int result; |
| 165 | 162 | ||
| 166 | |||
| 167 | if (!acpi_bus_get_device(handle, &device) && device) | 163 | if (!acpi_bus_get_device(handle, &device) && device) |
| 168 | goto end; | 164 | goto end; |
| 169 | 165 | ||
| 170 | status = acpi_get_parent(handle, &phandle); | ||
| 171 | if (ACPI_FAILURE(status)) { | ||
| 172 | ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent")); | ||
| 173 | return -EINVAL; | ||
| 174 | } | ||
| 175 | |||
| 176 | /* Get the parent device */ | ||
| 177 | result = acpi_bus_get_device(phandle, &pdevice); | ||
| 178 | if (result) { | ||
| 179 | acpi_handle_warn(phandle, "Cannot get acpi bus device\n"); | ||
| 180 | return -EINVAL; | ||
| 181 | } | ||
| 182 | |||
| 183 | /* | 166 | /* |
| 184 | * Now add the notified device. This creates the acpi_device | 167 | * Now add the notified device. This creates the acpi_device |
| 185 | * and invokes .add function | 168 | * and invokes .add function |
| 186 | */ | 169 | */ |
| 187 | result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); | 170 | result = acpi_bus_scan(handle); |
| 188 | if (result) { | 171 | if (result) { |
| 189 | acpi_handle_warn(handle, "Cannot add acpi bus\n"); | 172 | acpi_handle_warn(handle, "Cannot add acpi bus\n"); |
| 190 | return -EINVAL; | 173 | return -EINVAL; |
| 191 | } | 174 | } |
| 175 | result = acpi_bus_get_device(handle, &device); | ||
| 176 | if (result) { | ||
| 177 | acpi_handle_warn(handle, "Missing device object\n"); | ||
| 178 | return -EINVAL; | ||
| 179 | } | ||
| 192 | 180 | ||
| 193 | end: | 181 | end: |
| 194 | *mem_device = acpi_driver_data(device); | 182 | *mem_device = acpi_driver_data(device); |
| @@ -355,7 +343,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
| 355 | break; | 343 | break; |
| 356 | } | 344 | } |
| 357 | 345 | ||
| 358 | ej_event->handle = handle; | 346 | ej_event->device = device; |
| 359 | ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; | 347 | ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; |
| 360 | acpi_os_hotplug_execute(acpi_bus_hot_remove_device, | 348 | acpi_os_hotplug_execute(acpi_bus_hot_remove_device, |
| 361 | (void *)ej_event); | 349 | (void *)ej_event); |
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 811910b50b75..cc79d3e53a39 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c | |||
| @@ -135,30 +135,6 @@ static int acpi_container_remove(struct acpi_device *device, int type) | |||
| 135 | return status; | 135 | return status; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | static int container_device_add(struct acpi_device **device, acpi_handle handle) | ||
| 139 | { | ||
| 140 | acpi_handle phandle; | ||
| 141 | struct acpi_device *pdev; | ||
| 142 | int result; | ||
| 143 | |||
| 144 | |||
| 145 | if (acpi_get_parent(handle, &phandle)) { | ||
| 146 | return -ENODEV; | ||
| 147 | } | ||
| 148 | |||
| 149 | if (acpi_bus_get_device(phandle, &pdev)) { | ||
| 150 | return -ENODEV; | ||
| 151 | } | ||
| 152 | |||
| 153 | if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) { | ||
| 154 | return -ENODEV; | ||
| 155 | } | ||
| 156 | |||
| 157 | result = acpi_bus_start(*device); | ||
| 158 | |||
| 159 | return result; | ||
| 160 | } | ||
| 161 | |||
| 162 | static void container_notify_cb(acpi_handle handle, u32 type, void *context) | 138 | static void container_notify_cb(acpi_handle handle, u32 type, void *context) |
| 163 | { | 139 | { |
| 164 | struct acpi_device *device = NULL; | 140 | struct acpi_device *device = NULL; |
| @@ -190,11 +166,16 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) | |||
| 190 | if (!ACPI_FAILURE(status) || device) | 166 | if (!ACPI_FAILURE(status) || device) |
| 191 | break; | 167 | break; |
| 192 | 168 | ||
| 193 | result = container_device_add(&device, handle); | 169 | result = acpi_bus_scan(handle); |
| 194 | if (result) { | 170 | if (result) { |
| 195 | acpi_handle_warn(handle, "Failed to add container\n"); | 171 | acpi_handle_warn(handle, "Failed to add container\n"); |
| 196 | break; | 172 | break; |
| 197 | } | 173 | } |
| 174 | result = acpi_bus_get_device(handle, &device); | ||
| 175 | if (result) { | ||
| 176 | acpi_handle_warn(handle, "Missing device object\n"); | ||
| 177 | break; | ||
| 178 | } | ||
| 198 | 179 | ||
| 199 | kobject_uevent(&device->dev.kobj, KOBJ_ONLINE); | 180 | kobject_uevent(&device->dev.kobj, KOBJ_ONLINE); |
| 200 | ost_code = ACPI_OST_SC_SUCCESS; | 181 | ost_code = ACPI_OST_SC_SUCCESS; |
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index c6ff606c6d5b..995019063f64 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
| @@ -353,7 +353,7 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable) | |||
| 353 | * acpi_dev_pm_get_node - Get ACPI device node for the given physical device. | 353 | * acpi_dev_pm_get_node - Get ACPI device node for the given physical device. |
| 354 | * @dev: Device to get the ACPI node for. | 354 | * @dev: Device to get the ACPI node for. |
| 355 | */ | 355 | */ |
| 356 | static struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | 356 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev) |
| 357 | { | 357 | { |
| 358 | acpi_handle handle = DEVICE_ACPI_HANDLE(dev); | 358 | acpi_handle handle = DEVICE_ACPI_HANDLE(dev); |
| 359 | struct acpi_device *adev; | 359 | struct acpi_device *adev; |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index f32bd47b35e0..420d24fc9388 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
| @@ -310,8 +310,6 @@ static int dock_present(struct dock_station *ds) | |||
| 310 | static struct acpi_device * dock_create_acpi_device(acpi_handle handle) | 310 | static struct acpi_device * dock_create_acpi_device(acpi_handle handle) |
| 311 | { | 311 | { |
| 312 | struct acpi_device *device; | 312 | struct acpi_device *device; |
| 313 | struct acpi_device *parent_device; | ||
| 314 | acpi_handle parent; | ||
| 315 | int ret; | 313 | int ret; |
| 316 | 314 | ||
