PCI hotplug: fix oshp evaluation
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Wed, 4 Nov 2009 03:59:55 +0000 (05:59 +0200)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 6 Nov 2009 22:13:32 +0000 (14:13 -0800)
If firmware doesn't grant over native hotplug control through ACPI
_OSC method, we must not evaluate OSHP.

Acked-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/hotplug/acpi_pcihp.c

index a73028ec52e56cbd533a403bcda898d00c91cc95..6833d7bdbbff316f7f840a2028e648e1f40172ae 100644 (file)
@@ -362,6 +362,8 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev, u32 flags)
                status = acpi_pci_osc_control_set(handle, flags);
                if (ACPI_SUCCESS(status))
                        goto got_one;
+               if (status == AE_SUPPORT)
+                       goto no_control;
                kfree(string.pointer);
                string = (struct acpi_buffer){ ACPI_ALLOCATE_BUFFER, NULL };
        }
@@ -394,10 +396,9 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev, u32 flags)
                if (ACPI_FAILURE(status))
                        break;
        }
-
+no_control:
        dbg("Cannot get control of hotplug hardware for pci %s\n",
            pci_name(pdev));
-
        kfree(string.pointer);
        return -ENODEV;
 got_one: