Loading drivers/pnp/pnpacpi/core.c +26 −18 Original line number Diff line number Diff line Loading @@ -83,8 +83,7 @@ static int pnpacpi_set_resources(struct pnp_dev *dev) { struct acpi_device *acpi_dev; acpi_handle handle; struct acpi_buffer buffer; int ret; int ret = 0; pnp_dbg(&dev->dev, "set resources\n"); Loading @@ -97,19 +96,26 @@ static int pnpacpi_set_resources(struct pnp_dev *dev) if (WARN_ON_ONCE(acpi_dev != dev->data)) dev->data = acpi_dev; if (acpi_has_method(handle, METHOD_NAME__SRS)) { struct acpi_buffer buffer; ret = pnpacpi_build_resource_template(dev, &buffer); if (ret) return ret; ret = pnpacpi_encode_resources(dev, &buffer); if (ret) { if (!ret) { acpi_status status; status = acpi_set_current_resources(handle, &buffer); if (ACPI_FAILURE(status)) ret = -EIO; } kfree(buffer.pointer); return ret; } if (ACPI_FAILURE(acpi_set_current_resources(handle, &buffer))) ret = -EINVAL; else if (acpi_bus_power_manageable(handle)) if (!ret && acpi_bus_power_manageable(handle)) ret = acpi_bus_set_power(handle, ACPI_STATE_D0); kfree(buffer.pointer); return ret; } Loading @@ -117,7 +123,7 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) { struct acpi_device *acpi_dev; acpi_handle handle; int ret; acpi_status status; dev_dbg(&dev->dev, "disable resources\n"); Loading @@ -128,13 +134,15 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) } /* acpi_unregister_gsi(pnp_irq(dev, 0)); */ ret = 0; if (acpi_bus_power_manageable(handle)) acpi_bus_set_power(handle, ACPI_STATE_D3_COLD); /* continue even if acpi_bus_set_power() fails */ if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DIS", NULL, NULL))) ret = -ENODEV; return ret; status = acpi_evaluate_object(handle, "_DIS", NULL, NULL); if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) return -ENODEV; return 0; } #ifdef CONFIG_ACPI_SLEEP Loading drivers/pnp/quirks.c +2 −2 Original line number Diff line number Diff line Loading @@ -335,7 +335,7 @@ static void quirk_amd_mmconfig_area(struct pnp_dev *dev) } #endif #ifdef CONFIG_X86 #ifdef CONFIG_PCI /* Device IDs of parts that have 32KB MCH space */ static const unsigned int mch_quirk_devices[] = { 0x0154, /* Ivy Bridge */ Loading Loading @@ -440,7 +440,7 @@ static struct pnp_fixup pnp_fixups[] = { #ifdef CONFIG_AMD_NB {"PNP0c01", quirk_amd_mmconfig_area}, #endif #ifdef CONFIG_X86 #ifdef CONFIG_PCI {"PNP0c02", quirk_intel_mch}, #endif {""} Loading Loading
drivers/pnp/pnpacpi/core.c +26 −18 Original line number Diff line number Diff line Loading @@ -83,8 +83,7 @@ static int pnpacpi_set_resources(struct pnp_dev *dev) { struct acpi_device *acpi_dev; acpi_handle handle; struct acpi_buffer buffer; int ret; int ret = 0; pnp_dbg(&dev->dev, "set resources\n"); Loading @@ -97,19 +96,26 @@ static int pnpacpi_set_resources(struct pnp_dev *dev) if (WARN_ON_ONCE(acpi_dev != dev->data)) dev->data = acpi_dev; if (acpi_has_method(handle, METHOD_NAME__SRS)) { struct acpi_buffer buffer; ret = pnpacpi_build_resource_template(dev, &buffer); if (ret) return ret; ret = pnpacpi_encode_resources(dev, &buffer); if (ret) { if (!ret) { acpi_status status; status = acpi_set_current_resources(handle, &buffer); if (ACPI_FAILURE(status)) ret = -EIO; } kfree(buffer.pointer); return ret; } if (ACPI_FAILURE(acpi_set_current_resources(handle, &buffer))) ret = -EINVAL; else if (acpi_bus_power_manageable(handle)) if (!ret && acpi_bus_power_manageable(handle)) ret = acpi_bus_set_power(handle, ACPI_STATE_D0); kfree(buffer.pointer); return ret; } Loading @@ -117,7 +123,7 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) { struct acpi_device *acpi_dev; acpi_handle handle; int ret; acpi_status status; dev_dbg(&dev->dev, "disable resources\n"); Loading @@ -128,13 +134,15 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) } /* acpi_unregister_gsi(pnp_irq(dev, 0)); */ ret = 0; if (acpi_bus_power_manageable(handle)) acpi_bus_set_power(handle, ACPI_STATE_D3_COLD); /* continue even if acpi_bus_set_power() fails */ if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DIS", NULL, NULL))) ret = -ENODEV; return ret; status = acpi_evaluate_object(handle, "_DIS", NULL, NULL); if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) return -ENODEV; return 0; } #ifdef CONFIG_ACPI_SLEEP Loading
drivers/pnp/quirks.c +2 −2 Original line number Diff line number Diff line Loading @@ -335,7 +335,7 @@ static void quirk_amd_mmconfig_area(struct pnp_dev *dev) } #endif #ifdef CONFIG_X86 #ifdef CONFIG_PCI /* Device IDs of parts that have 32KB MCH space */ static const unsigned int mch_quirk_devices[] = { 0x0154, /* Ivy Bridge */ Loading Loading @@ -440,7 +440,7 @@ static struct pnp_fixup pnp_fixups[] = { #ifdef CONFIG_AMD_NB {"PNP0c01", quirk_amd_mmconfig_area}, #endif #ifdef CONFIG_X86 #ifdef CONFIG_PCI {"PNP0c02", quirk_intel_mch}, #endif {""} Loading