===================================================================
@@ -205,7 +205,6 @@ static int acpi_scan_hot_remove(struct a
/* If there is no handle, the device node has been unregistered. */
if (!handle) {
dev_dbg(&device->dev, "ACPI handle missing\n");
- put_device(&device->dev);
return -EINVAL;
}
@@ -226,7 +225,6 @@ static int acpi_scan_hot_remove(struct a
dev_warn(errdev, "Offline disabled.\n");
acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
acpi_bus_online, NULL, NULL, NULL);
- put_device(&device->dev);
return -EPERM;
}
acpi_bus_offline(handle, 0, (void *)false, (void **)&errdev);
@@ -245,7 +243,6 @@ static int acpi_scan_hot_remove(struct a
acpi_walk_namespace(ACPI_TYPE_ANY, handle,
ACPI_UINT32_MAX, acpi_bus_online,
NULL, NULL, NULL);
- put_device(&device->dev);
return -EBUSY;
}
}
@@ -256,7 +253,6 @@ static int acpi_scan_hot_remove(struct a
acpi_bus_trim(device);
/* Device node has been unregistered. */
- put_device(&device->dev);
device = NULL;
acpi_evaluate_lck(handle, 0);
@@ -310,7 +306,6 @@ static void acpi_bus_device_eject(acpi_h
if (handler->hotplug.mode == AHM_CONTAINER)
kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
- get_device(&device->dev);
error = acpi_scan_hot_remove(device);
if (error == -EPERM) {
goto err_support;