diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-22 19:09:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-30 01:48:04 -0400 |
commit | 23d3d602cb96addd3c1158424fb01a49ea5e81b1 (patch) | |
tree | 2daa85579c964bfe3d1a91fe365d202b8f38422b /drivers | |
parent | afdce75f1eaebcf358b7594ba7969aade105c3b0 (diff) |
[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')
-rw-r--r-- | drivers/base/bus.c | 27 |
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) | |||
483 | /* Helper for bus_rescan_devices's iter */ | 483 | /* Helper for bus_rescan_devices's iter */ |
484 | static int bus_rescan_devices_helper(struct device *dev, void *data) | 484 | static int bus_rescan_devices_helper(struct device *dev, void *data) |
485 | { | 485 | { |
486 | int *count = data; | 486 | if (!dev->driver) |
487 | 487 | device_attach(dev); | |
488 | if (!dev->driver && (device_attach(dev) > 0)) | ||
489 | (*count)++; | ||
490 | |||
491 | return 0; | 488 | return 0; |
492 | } | 489 | } |
493 | 490 | ||
494 | |||
495 | /** | 491 | /** |
496 | * bus_rescan_devices - rescan devices on the bus for possible drivers | 492 | * bus_rescan_devices - rescan devices on the bus for possible drivers |
497 | * @bus: the bus to scan. | 493 | * @bus: the bus to scan. |
498 | * | 494 | * |
499 | * This function will look for devices on the bus with no driver | 495 | * This function will look for devices on the bus with no driver |
500 | * attached and rescan it against existing drivers to see if it | 496 | * attached and rescan it against existing drivers to see if it matches |
501 | * matches any. Calls device_attach(). Returns the number of devices | 497 | * any by calling device_attach() for the unbound devices. |
502 | * that were sucessfully bound to a driver. | ||
503 | */ | 498 | */ |
504 | int bus_rescan_devices(struct bus_type * bus) | 499 | void bus_rescan_devices(struct bus_type * bus) |
505 | { | 500 | { |
506 | int count = 0; | 501 | bus_for_each_dev(bus, NULL, NULL, bus_rescan_devices_helper); |
507 | |||
508 | bus_for_each_dev(bus, NULL, &count, bus_rescan_devices_helper); | ||
509 | |||
510 | return count; | ||
511 | } | 502 | } |
512 | 503 | ||
513 | 504 | ||