===================================================================
@@ -617,11 +617,8 @@ static void disable_slot(struct acpiphp_
slot->flags &= (~SLOT_ENABLED);
}
-static bool acpiphp_no_hotplug(acpi_handle handle)
+static bool acpiphp_no_hotplug(struct acpi_device *adev)
{
- struct acpi_device *adev = NULL;
-
- acpi_bus_get_device(handle, &adev);
return adev && adev->flags.no_hotplug;
}
@@ -629,10 +626,13 @@ static bool slot_no_hotplug(struct acpip
{
struct acpiphp_func *func;
- list_for_each_entry(func, &slot->funcs, sibling)
- if (acpiphp_no_hotplug(func_to_handle(func)))
- return true;
+ list_for_each_entry(func, &slot->funcs, sibling) {
+ struct acpi_device *adev = NULL;
+ acpi_bus_get_device(func_to_handle(func), &adev);
+ if (acpiphp_no_hotplug(adev))
+ return true;
+ }
return false;
}
@@ -689,13 +689,12 @@ static void trim_stale_devices(struct pc
bool alive = false;
if (adev) {
- acpi_handle handle = adev->handle;
acpi_status status;
unsigned long long sta;
- status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
+ status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta);
alive = (ACPI_SUCCESS(status) && sta == ACPI_STA_ALL)
- || acpiphp_no_hotplug(handle);
+ || acpiphp_no_hotplug(adev);
}
if (!alive) {
u32 v;