--- drivers/pnp/driver.c | 7 +++++-- drivers/pnp/pnpacpi/core.c | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) Index: linux-2.6/drivers/pnp/pnpacpi/core.c =================================================================== --- linux-2.6.orig/drivers/pnp/pnpacpi/core.c +++ linux-2.6/drivers/pnp/pnpacpi/core.c @@ -158,12 +158,23 @@ static int pnpacpi_suspend(struct pnp_de static int pnpacpi_resume(struct pnp_dev *dev) { - struct acpi_device *acpi_dev = dev->data; - acpi_handle handle = acpi_dev->handle; + struct acpi_device *acpi_dev; + acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); + int error = 0; + + if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &acpi_dev))) { + dev_info(&dev->dev, "ACPI handle has no context in %s!\n", + __func__); + return -EINVAL; + } if (device_may_wakeup(&dev->dev)) acpi_pm_device_sleep_wake(&dev->dev, false); - return acpi_bus_set_power(handle, ACPI_STATE_D0); + + if (acpi_bus_power_manageable(handle)) + error = acpi_bus_set_power(handle, ACPI_STATE_D0); + + return error; } #endif Index: linux-2.6/drivers/pnp/driver.c =================================================================== --- linux-2.6.orig/drivers/pnp/driver.c +++ linux-2.6/drivers/pnp/driver.c @@ -189,8 +189,11 @@ static int pnp_bus_resume(struct device if (!pnp_drv) return 0; - if (pnp_dev->protocol->resume) - pnp_dev->protocol->resume(pnp_dev); + if (pnp_dev->protocol->resume) { + error = pnp_dev->protocol->resume(pnp_dev); + if (error) + return error; + } if (pnp_can_write(pnp_dev)) { error = pnp_start_dev(pnp_dev);