summaryrefslogtreecommitdiffstats
path: root/drivers/base/bus.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2005-06-23 01:09:05 +0200
committerGreg Kroah-Hartman2005-06-30 07:48:04 +0200
commit23d3d602cb96addd3c1158424fb01a49ea5e81b1 (patch)
tree2daa85579c964bfe3d1a91fe365d202b8f38422b /drivers/base/bus.c
parent[PATCH] driver core: Add the ability to bind drivers to devices from userspace (diff)
downloadkernel-qcow2-linux-23d3d602cb96addd3c1158424fb01a49ea5e81b1.tar.gz
kernel-qcow2-linux-23d3d602cb96addd3c1158424fb01a49ea5e81b1.tar.xz
kernel-qcow2-linux-23d3d602cb96addd3c1158424fb01a49ea5e81b1.zip
[PATCH] driver core: change bus_rescan_devices to return void
No one was looking at the return value of bus_rescan_devices, and it really wasn't anything that anyone in the kernel would ever care about. So change it which enabled some counting code to be removed also. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r--drivers/base/bus.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 7e17488271a8..96fe2f956754 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -483,31 +483,22 @@ void bus_remove_driver(struct device_driver * drv)
/* Helper for bus_rescan_devices's iter */
static int bus_rescan_devices_helper(struct device *dev, void *data)
{
- int *count = data;
-
- if (!dev->driver && (device_attach(dev) > 0))
- (*count)++;
-
+ if (!dev->driver)
+ device_attach(dev);
return 0;
}
-
/**
- * bus_rescan_devices - rescan devices on the bus for possible drivers
- * @bus: the bus to scan.
+ * bus_rescan_devices - rescan devices on the bus for possible drivers
+ * @bus: the bus to scan.
*
- * This function will look for devices on the bus with no driver
- * attached and rescan it against existing drivers to see if it
- * matches any. Calls device_attach(). Returns the number of devices
- * that were sucessfully bound to a driver.
+ * This function will look for devices on the bus with no driver
+ * attached and rescan it against existing drivers to see if it matches
+ * any by calling device_attach() for the unbound devices.
*/
-int bus_rescan_devices(struct bus_type * bus)
+void bus_rescan_devices(struct bus_type * bus)
{
- int count = 0;
-
- bus_for_each_dev(bus, NULL, &count, bus_rescan_devices_helper);
-
- return count;
+ bus_for_each_dev(bus, NULL, NULL, bus_rescan_devices_helper);
}