diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-18 19:05:46 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-18 19:05:46 -0500 |
commit | 614d7426ec109501e9e77be66963caf3041e566c (patch) | |
tree | 790b6699c381ba1e42b3bc0383047b225662fb08 /drivers | |
parent | f86e7bc9683ee6dbde56d4bd4fda65f085b814d0 (diff) | |
parent | 883461679ad1ed6e09135adf8c02bb98d7962623 (diff) |
Merge branch 'acpi-hotplug'
* acpi-hotplug:
ACPI / scan: Set flags.match_driver in acpi_bus_scan_fixed()
ACPI / PCI root: Clear driver_data before failing enumeration
ACPI / hotplug: Fix PCI host bridge hot removal
ACPI / hotplug: Fix acpi_bus_get_device() return value check
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/pci_root.c | 1 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 14 |
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 56f05869b08d..0703bff5e60e 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -575,6 +575,7 @@ static int acpi_pci_root_add(struct acpi_device *device, | |||
575 | dev_err(&device->dev, | 575 | dev_err(&device->dev, |
576 | "Bus %04x:%02x not present in PCI namespace\n", | 576 | "Bus %04x:%02x not present in PCI namespace\n", |
577 | root->segment, (unsigned int)root->secondary.start); | 577 | root->segment, (unsigned int)root->secondary.start); |
578 | device->driver_data = NULL; | ||
578 | result = -ENODEV; | 579 | result = -ENODEV; |
579 | goto end; | 580 | goto end; |
580 | } | 581 | } |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 55f9dedbbf9f..15daa21fcd05 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -289,24 +289,17 @@ void acpi_bus_device_eject(void *data, u32 ost_src) | |||
289 | { | 289 | { |
290 | struct acpi_device *device = data; | 290 | struct acpi_device *device = data; |
291 | acpi_handle handle = device->handle; | 291 | acpi_handle handle = device->handle; |
292 | struct acpi_scan_handler *handler; | ||
293 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; | 292 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; |
294 | int error; | 293 | int error; |
295 | 294 | ||
296 | lock_device_hotplug(); | 295 | lock_device_hotplug(); |
297 | mutex_lock(&acpi_scan_lock); | 296 | mutex_lock(&acpi_scan_lock); |
298 | 297 | ||
299 | handler = device->handler; | ||
300 | if (!handler || !handler->hotplug.enabled) { | ||
301 | put_device(&device->dev); | ||
302 | goto err_support; | ||
303 | } | ||
304 | |||
305 | if (ost_src == ACPI_NOTIFY_EJECT_REQUEST) | 298 | if (ost_src == ACPI_NOTIFY_EJECT_REQUEST) |
306 | acpi_evaluate_hotplug_ost(handle, ACPI_NOTIFY_EJECT_REQUEST, | 299 | acpi_evaluate_hotplug_ost(handle, ACPI_NOTIFY_EJECT_REQUEST, |
307 | ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); | 300 | ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); |
308 | 301 | ||
309 | if (handler->hotplug.mode == AHM_CONTAINER) | 302 | if (device->handler && device->handler->hotplug.mode == AHM_CONTAINER) |
310 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); | 303 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); |
311 | 304 | ||
312 | error = acpi_scan_hot_remove(device); | 305 | error = acpi_scan_hot_remove(device); |
@@ -411,8 +404,7 @@ static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data) | |||
411 | break; | 404 | break; |
412 | case ACPI_NOTIFY_EJECT_REQUEST: | 405 | case ACPI_NOTIFY_EJECT_REQUEST: |
413 | acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n"); | 406 | acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n"); |
414 | status = acpi_bus_get_device(handle, &adev); | 407 | if (acpi_bus_get_device(handle, &adev)) |
415 | if (ACPI_FAILURE(status)) | ||
416 | goto err_out; | 408 | goto err_out; |
417 | 409 | ||
418 | get_device(&adev->dev); | 410 | get_device(&adev->dev); |
@@ -1997,6 +1989,7 @@ static int acpi_bus_scan_fixed(void) | |||
1997 | if (result) | 1989 | if (result) |
1998 | return result; | 1990 | return result; |
1999 | 1991 | ||
1992 | device->flags.match_driver = true; | ||
2000 | result = device_attach(&device->dev); | 1993 | result = device_attach(&device->dev); |
2001 | if (result < 0) | 1994 | if (result < 0) |
2002 | return result; | 1995 | return result; |
@@ -2013,6 +2006,7 @@ static int acpi_bus_scan_fixed(void) | |||
2013 | if (result) | 2006 | if (result) |
2014 | return result; | 2007 | return result; |
2015 | 2008 | ||
2009 | device->flags.match_driver = true; | ||
2016 | result = device_attach(&device->dev); | 2010 | result = device_attach(&device->dev); |
2017 | } | 2011 | } |
2018 | 2012 | ||