Commit ae281795 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI / scan: Drop the second argument of acpi_bus_trim()

All callers of acpi_bus_trim() pass 1 (true) as the second argument
of it, so remove that argument entirely and change acpi_bus_trim()
to always behave as though it were 1.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarToshi Kani <toshi.kani@hp.com>
Acked-by: default avatarYinghai Lu <yinghai@kernel.org>
Acked-by: default avatarYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
parent b17b537a
...@@ -339,7 +339,7 @@ static void dock_remove_acpi_device(acpi_handle handle) ...@@ -339,7 +339,7 @@ static void dock_remove_acpi_device(acpi_handle handle)
int ret; int ret;
if (!acpi_bus_get_device(handle, &device)) { if (!acpi_bus_get_device(handle, &device)) {
ret = acpi_bus_trim(device, 1); ret = acpi_bus_trim(device);
if (ret) if (ret)
pr_debug("error removing bus, %x\n", -ret); pr_debug("error removing bus, %x\n", -ret);
} }
......
...@@ -133,7 +133,7 @@ void acpi_bus_hot_remove_device(void *context) ...@@ -133,7 +133,7 @@ void acpi_bus_hot_remove_device(void *context)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Hot-removing device %s...\n", dev_name(&device->dev))); "Hot-removing device %s...\n", dev_name(&device->dev)));
if (acpi_bus_trim(device, 1)) { if (acpi_bus_trim(device)) {
printk(KERN_ERR PREFIX printk(KERN_ERR PREFIX
"Removing device failed\n"); "Removing device failed\n");
goto err_out; goto err_out;
...@@ -1374,7 +1374,7 @@ static int acpi_device_set_context(struct acpi_device *device) ...@@ -1374,7 +1374,7 @@ static int acpi_device_set_context(struct acpi_device *device)
return -ENODEV; return -ENODEV;
} }
static int acpi_bus_remove(struct acpi_device *dev, int rmdevice) static int acpi_bus_remove(struct acpi_device *dev)
{ {
if (!dev) if (!dev)
return -EINVAL; return -EINVAL;
...@@ -1382,9 +1382,6 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice) ...@@ -1382,9 +1382,6 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
dev->removal_type = ACPI_BUS_REMOVAL_EJECT; dev->removal_type = ACPI_BUS_REMOVAL_EJECT;
device_release_driver(&dev->dev); device_release_driver(&dev->dev);
if (!rmdevice)
return 0;
acpi_device_unregister(dev); acpi_device_unregister(dev);
return 0; return 0;
...@@ -1642,7 +1639,7 @@ int acpi_bus_add(acpi_handle handle) ...@@ -1642,7 +1639,7 @@ int acpi_bus_add(acpi_handle handle)
} }
EXPORT_SYMBOL(acpi_bus_add); EXPORT_SYMBOL(acpi_bus_add);
int acpi_bus_trim(struct acpi_device *start, int rmdevice) int acpi_bus_trim(struct acpi_device *start)
{ {
acpi_status status; acpi_status status;
struct acpi_device *parent, *child; struct acpi_device *parent, *child;
...@@ -1668,12 +1665,7 @@ int acpi_bus_trim(struct acpi_device *start, int rmdevice) ...@@ -1668,12 +1665,7 @@ int acpi_bus_trim(struct acpi_device *start, int rmdevice)
acpi_get_parent(phandle, &phandle); acpi_get_parent(phandle, &phandle);
child = parent; child = parent;
parent = parent->parent; parent = parent->parent;
err = acpi_bus_remove(child);
if (level == 0)
err = acpi_bus_remove(child, rmdevice);
else
err = acpi_bus_remove(child, 1);
continue; continue;
} }
......
...@@ -742,7 +742,7 @@ static int acpiphp_bus_add(struct acpiphp_func *func) ...@@ -742,7 +742,7 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
/* this shouldn't be in here, so remove /* this shouldn't be in here, so remove
* the bus then re-add it... * the bus then re-add it...
*/ */
ret_val = acpi_bus_trim(device, 1); ret_val = acpi_bus_trim(device);
dbg("acpi_bus_trim return %x\n", ret_val); dbg("acpi_bus_trim return %x\n", ret_val);
} }
...@@ -772,7 +772,7 @@ static int acpiphp_bus_trim(acpi_handle handle) ...@@ -772,7 +772,7 @@ static int acpiphp_bus_trim(acpi_handle handle)
return retval; return retval;
} }
retval = acpi_bus_trim(device, 1); retval = acpi_bus_trim(device);
if (retval) if (retval)
err("cannot remove from acpi list\n"); err("cannot remove from acpi list\n");
......
...@@ -535,7 +535,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot) ...@@ -535,7 +535,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
ret = acpi_bus_get_device(chandle, ret = acpi_bus_get_device(chandle,
&device); &device);
if (ACPI_SUCCESS(ret)) if (ACPI_SUCCESS(ret))
acpi_bus_trim(device, 1); acpi_bus_trim(device);
} }
} }
......
...@@ -348,7 +348,7 @@ int acpi_bus_register_driver(struct acpi_driver *driver); ...@@ -348,7 +348,7 @@ int acpi_bus_register_driver(struct acpi_driver *driver);
void acpi_bus_unregister_driver(struct acpi_driver *driver); void acpi_bus_unregister_driver(struct acpi_driver *driver);
int acpi_bus_add(acpi_handle handle); int acpi_bus_add(acpi_handle handle);
void acpi_bus_hot_remove_device(void *context); void acpi_bus_hot_remove_device(void *context);
int acpi_bus_trim(struct acpi_device *start, int rmdevice); int acpi_bus_trim(struct acpi_device *start);
acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
int acpi_match_device_ids(struct acpi_device *device, int acpi_match_device_ids(struct acpi_device *device,
const struct acpi_device_id *ids); const struct acpi_device_id *ids);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment