aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-15 07:23:53 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-15 07:23:53 -0500
commitae281795ec92d35dd1631401829124acab965b1f (patch)
treefbe1444521184eef3927aa0a8bb13e1da4356a9a
parentb17b537ac1429a609addb55bf985f5ebfcf4ae7b (diff)
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: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
-rw-r--r--drivers/acpi/dock.c2
-rw-r--r--drivers/acpi/scan.c16
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c4
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c2
-rw-r--r--include/acpi/acpi_bus.h2
5 files changed, 9 insertions, 17 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 9e31b2bd93d3..4a56a8b2e51e 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -339,7 +339,7 @@ static void dock_remove_acpi_device(acpi_handle handle)
339 int ret; 339 int ret;
340 340
341 if (!acpi_bus_get_device(handle, &device)) { 341 if (!acpi_bus_get_device(handle, &device)) {
342 ret = acpi_bus_trim(device, 1); 342 ret = acpi_bus_trim(device);
343 if (ret) 343 if (ret)
344 pr_debug("error removing bus, %x\n", -ret); 344 pr_debug("error removing bus, %x\n", -ret);
345 } 345 }
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a26c09efc286..d14ce446b469 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -133,7 +133,7 @@ void acpi_bus_hot_remove_device(void *context)
133 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 133 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
134 "Hot-removing device %s...\n", dev_name(&device->dev))); 134 "Hot-removing device %s...\n", dev_name(&device->dev)));
135 135
136 if (acpi_bus_trim(device, 1)) { 136 if (acpi_bus_trim(device)) {
137 printk(KERN_ERR PREFIX 137 printk(KERN_ERR PREFIX
138 "Removing device failed\n"); 138 "Removing device failed\n");
139 goto err_out; 139 goto err_out;
@@ -1374,7 +1374,7 @@ static int acpi_device_set_context(struct acpi_device *device)
1374 return -ENODEV; 1374 return -ENODEV;
1375} 1375}
1376 1376
1377static int acpi_bus_remove(struct acpi_device *dev, int rmdevice) 1377static int acpi_bus_remove(struct acpi_device *dev)
1378{ 1378{
1379 if (!dev) 1379 if (!dev)
1380 return -EINVAL; 1380 return -EINVAL;
@@ -1382,9 +1382,6 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
1382 dev->removal_type = ACPI_BUS_REMOVAL_EJECT; 1382 dev->removal_type = ACPI_BUS_REMOVAL_EJECT;
1383 device_release_driver(&dev->dev); 1383 device_release_driver(&dev->dev);
1384 1384
1385 if (!rmdevice)
1386 return 0;
1387
1388 acpi_device_unregister(dev); 1385 acpi_device_unregister(dev);
1389 1386
1390 return 0; 1387 return 0;
@@ -1642,7 +1639,7 @@ int acpi_bus_add(acpi_handle handle)
1642} 1639}
1643EXPORT_SYMBOL(acpi_bus_add); 1640EXPORT_SYMBOL(acpi_bus_add);
1644 1641
1645int acpi_bus_trim(struct acpi_device *start, int rmdevice) 1642int acpi_bus_trim(struct acpi_device *start)
1646{ 1643{
1647 acpi_status status; 1644 acpi_status status;
1648 struct acpi_device *parent, *child; 1645 struct acpi_device *parent, *child;
@@ -1668,12 +1665,7 @@ int acpi_bus_trim(struct acpi_device *start, int rmdevice)
1668 acpi_get_parent(phandle, &phandle); 1665 acpi_get_parent(phandle, &phandle);
1669 child = parent; 1666 child = parent;
1670 parent = parent->parent; 1667 parent = parent->parent;
1671 1668 err = acpi_bus_remove(child);
1672 if (level == 0)
1673 err = acpi_bus_remove(child, rmdevice);
1674 else
1675 err = acpi_bus_remove(child, 1);
1676
1677 continue; 1669 continue;
1678 } 1670 }
1679 1671
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 91b5ad875c53..22006f2d9dd5 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -742,7 +742,7 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
742 /* this shouldn't be in here, so remove 742 /* this shouldn't be in here, so remove
743 * the bus then re-add it... 743 * the bus then re-add it...
744 */ 744 */
745 ret_val = acpi_bus_trim(device, 1); 745 ret_val = acpi_bus_trim(device);
746 dbg("acpi_bus_trim return %x\n", ret_val); 746 dbg("acpi_bus_trim return %x\n", ret_val);
747 } 747 }
748 748
@@ -772,7 +772,7 @@ static int acpiphp_bus_trim(acpi_handle handle)
772 return retval; 772 return retval;
773 } 773 }
774 774
775 retval = acpi_bus_trim(device, 1); 775 retval = acpi_bus_trim(device);
776 if (retval) 776 if (retval)
777 err("cannot remove from acpi list\n"); 777 err("cannot remove from acpi list\n");
778 778
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index f3c419256d2a..2e006ee5738b 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -535,7 +535,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
535 ret = acpi_bus_get_device(chandle, 535 ret = acpi_bus_get_device(chandle,
536 &device); 536 &device);
537 if (ACPI_SUCCESS(ret)) 537 if (ACPI_SUCCESS(ret))
538 acpi_bus_trim(device, 1); 538 acpi_bus_trim(device);
539 } 539 }
540 } 540 }
541 541
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index efe5f746c561..566f1fdabbd2 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -348,7 +348,7 @@ int acpi_bus_register_driver(struct acpi_driver *driver);
348void acpi_bus_unregister_driver(struct acpi_driver *driver); 348void acpi_bus_unregister_driver(struct acpi_driver *driver);
349int acpi_bus_add(acpi_handle handle); 349int acpi_bus_add(acpi_handle handle);
350void acpi_bus_hot_remove_device(void *context); 350void acpi_bus_hot_remove_device(void *context);
351int acpi_bus_trim(struct acpi_device *start, int rmdevice); 351int acpi_bus_trim(struct acpi_device *start);
352acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); 352acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
353int acpi_match_device_ids(struct acpi_device *device, 353int acpi_match_device_ids(struct acpi_device *device,
354 const struct acpi_device_id *ids); 354 const struct acpi_device_id *ids);