summaryrefslogtreecommitdiffstats
path: root/drivers/base/bus.c
diff options
context:
space:
mode:
authorMoore, Eric2006-03-14 17:18:18 +0100
committerJames Bottomley2006-03-14 19:50:44 +0100
commite935d5da8e5d12fabe5b632736c50eae0427e8c8 (patch)
tree8045ffcaa659365ed1d844e7704b92810660c8b1 /drivers/base/bus.c
parent[SCSI] add preliminary expander support to the sas transport class (diff)
downloadkernel-qcow2-linux-e935d5da8e5d12fabe5b632736c50eae0427e8c8.tar.gz
kernel-qcow2-linux-e935d5da8e5d12fabe5b632736c50eae0427e8c8.tar.xz
kernel-qcow2-linux-e935d5da8e5d12fabe5b632736c50eae0427e8c8.zip
[SCSI] drivers/base/bus.c - export reprobe
Adding support for exposing hidden raid components for sg interface. The sdev->no_uld_attach flag will set set accordingly. The sas module supports adding/removing raid volumes using online storage management application interface. This patch was provided to me by Christoph Hellwig. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r--drivers/base/bus.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index c3141565d59d..48718b7f4fa0 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -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)
{