]> err.no Git - linux-2.6/commitdiff
[SCSI] drivers/base/bus.c - export reprobe
authorMoore, Eric <Eric.Moore@lsil.com>
Tue, 14 Mar 2006 16:18:18 +0000 (09:18 -0700)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Tue, 14 Mar 2006 18:50:44 +0000 (12:50 -0600)
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>
drivers/base/bus.c
include/linux/device.h

index c3141565d59d503250fce52deddbd4df74ffe9ac..48718b7f4fa01737326174f42a775cdabbcc81a8 100644 (file)
@@ -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)
 {
index 58df18d9cd3ebe4f218d1d13d119293879a77088..e8ac5bcfbec7fd57d1b555c78715d9034e37a62f 100644 (file)
@@ -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);
 
 
 /*