Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22634
b: refs/heads/master
c: e935d5d
h: refs/heads/master
v: v3
  • Loading branch information
Moore, Eric authored and James Bottomley committed Mar 14, 2006
1 parent c8ca75d commit 4d3678e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79cb1819e231f811211133a09a5382cb89d7ec67
refs/heads/master: e935d5da8e5d12fabe5b632736c50eae0427e8c8
22 changes: 22 additions & 0 deletions trunk/drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,28 @@ void bus_rescan_devices(struct bus_type * bus)
bus_for_each_dev(bus, NULL, NULL, bus_rescan_devices_helper);
}

/**
* device_reprobe - remove driver for a device and probe for a new driver
* @dev: the device to reprobe
*
* This function detaches the attached driver (if any) for the given
* device and restarts the driver probing process. It is intended
* to use if probing criteria changed during a devices lifetime and
* driver attachment should change accordingly.
*/
void device_reprobe(struct device *dev)
{
if (dev->driver) {
if (dev->parent) /* Needed for USB */
down(&dev->parent->sem);
device_release_driver(dev);
if (dev->parent)
up(&dev->parent->sem);
}

bus_rescan_devices_helper(dev, NULL);
}
EXPORT_SYMBOL_GPL(device_reprobe);

struct bus_type * get_bus(struct bus_type * bus)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ extern void device_bind_driver(struct device * dev);
extern void device_release_driver(struct device * dev);
extern int device_attach(struct device * dev);
extern void driver_attach(struct device_driver * drv);
extern void device_reprobe(struct device *dev);


/*
Expand Down

0 comments on commit 4d3678e

Please sign in to comment.