Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4037
b: refs/heads/master
c: 23d3d60
h: refs/heads/master
i:
  4035: fed9ef4
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jun 30, 2005
1 parent bf98ac8 commit 91a580b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: afdce75f1eaebcf358b7594ba7969aade105c3b0
refs/heads/master: 23d3d602cb96addd3c1158424fb01a49ea5e81b1
27 changes: 9 additions & 18 deletions trunk/drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct bus_type {
extern int bus_register(struct bus_type * bus);
extern void bus_unregister(struct bus_type * bus);

extern int bus_rescan_devices(struct bus_type * bus);
extern void bus_rescan_devices(struct bus_type * bus);

extern struct bus_type * get_bus(struct bus_type * bus);
extern void put_bus(struct bus_type * bus);
Expand Down

0 comments on commit 91a580b

Please sign in to comment.