From: "Moore, Eric" <Eric.Moore@lsil.com>
To: Greg KH <gregkh@suse.de>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
James.Bottomley@SteelEye.com, hch@lst.de
Subject: RE: [PATCH ] drivers/base/bus.c - export reprobe
Date: Tue, 14 Mar 2006 09:18:18 -0700 [thread overview]
Message-ID: <F331B95B72AFFB4B87467BE1C8E9CF5F36D938@NAMAIL2.ad.lsil.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 216 bytes --]
On Tuesday, March 14, 2006 8:35 AM, Greg KH wrote:
>
> base64 for the attachment with DOS line ends? ugh, can you please fix
> this up and resend?
>
Here is repost of patch due to dos line endings.
[-- Attachment #2: rescan_device --]
[-- Type: application/octet-stream, Size: 1641 bytes --]
Index: scsi-misc-2.6/drivers/base/bus.c
===================================================================
--- scsi-misc-2.6.orig/drivers/base/bus.c 2006-03-04 13:07:40.000000000 +0100
+++ scsi-misc-2.6/drivers/base/bus.c 2006-03-07 21:06:59.000000000 +0100
@@ -536,6 +536,28 @@
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: scsi-misc-2.6/include/linux/device.h
===================================================================
--- scsi-misc-2.6.orig/include/linux/device.h 2006-03-04 13:07:49.000000000 +0100
+++ scsi-misc-2.6/include/linux/device.h 2006-03-07 20:53:43.000000000 +0100
@@ -378,6 +378,7 @@
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);
/*
next reply other threads:[~2006-03-14 16:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-14 16:18 Moore, Eric [this message]
2006-03-14 16:27 ` [PATCH ] drivers/base/bus.c - export reprobe Jan-Benedict Glaw
2006-03-14 16:50 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2006-03-14 22:01 Moore, Eric
2006-03-14 22:31 ` Greg KH
2006-03-14 0:52 Moore, Eric
2006-03-14 15:34 ` Greg KH
2006-03-14 17:08 ` Christoph Hellwig
2006-03-14 17:19 ` Greg KH
2006-03-14 17:25 ` Christoph Hellwig
2006-03-14 17:29 ` Greg KH
2006-03-14 17:43 ` James Bottomley
2006-03-14 17:57 ` Greg KH
2006-03-14 22:43 ` James Bottomley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F331B95B72AFFB4B87467BE1C8E9CF5F36D938@NAMAIL2.ad.lsil.com \
--to=eric.moore@lsil.com \
--cc=James.Bottomley@SteelEye.com \
--cc=gregkh@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).