diff options
author | Moore, Eric <Eric.Moore@lsil.com> | 2006-03-14 11:18:18 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-14 13:50:44 -0500 |
commit | e935d5da8e5d12fabe5b632736c50eae0427e8c8 (patch) | |
tree | 8045ffcaa659365ed1d844e7704b92810660c8b1 /drivers/base/bus.c | |
parent | 79cb1819e231f811211133a09a5382cb89d7ec67 (diff) |
[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.c | 22 |
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) | |||
536 | bus_for_each_dev(bus, NULL, NULL, bus_rescan_devices_helper); | 536 | bus_for_each_dev(bus, NULL, NULL, bus_rescan_devices_helper); |
537 | } | 537 | } |
538 | 538 | ||
539 | /** | ||
540 | * device_reprobe - remove driver for a device and probe for a new driver | ||
541 | * @dev: the device to reprobe | ||
542 | * | ||
543 | * This function detaches the attached driver (if any) for the given | ||
544 | * device and restarts the driver probing process. It is intended | ||
545 | * to use if probing criteria changed during a devices lifetime and | ||
546 | * driver attachment should change accordingly. | ||
547 | */ | ||
548 | void device_reprobe(struct device *dev) | ||
549 | { | ||
550 | if (dev->driver) { | ||
551 | if (dev->parent) /* Needed for USB */ | ||
552 | down(&dev->parent->sem); | ||
553 | device_release_driver(dev); | ||
554 | if (dev->parent) | ||
555 | up(&dev->parent->sem); | ||
556 | } | ||
557 | |||
558 | bus_rescan_devices_helper(dev, NULL); | ||
559 | } | ||
560 | EXPORT_SYMBOL_GPL(device_reprobe); | ||
539 | 561 | ||
540 | struct bus_type * get_bus(struct bus_type * bus) | 562 | struct bus_type * get_bus(struct bus_type * bus) |
541 | { | 563 | { |