Re: [RFC] put symbolic links between drivers and modules in the sysfs tree
From: Greg KH
Date: Wed Sep 22 2004 - 18:09:47 EST
On Wed, Sep 22, 2004 at 04:04:23PM -0700, Greg KH wrote:
> I'll post my usb core change after this, to show you how USB can
> be hooked up to it.
And here's the 3 line patch that I added to the usb core to hook up both
the usb and usb-serial drivers to support the modules symlinks.
I'll go mess with the pci core now, but as there is no "struct module *"
in the pci driver structure, it will take a bit of auditing to get them
all hooked up properly.
thanks,
greg k-h
------
USB: add support for symlink from usb and usb-serial driver to its module in sysfs
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>
diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.c 2004-09-22 15:56:44 -07:00
+++ b/drivers/usb/core/usb.c 2004-09-22 15:56:44 -07:00
@@ -76,6 +76,7 @@
}
static struct device_driver usb_generic_driver = {
+ .owner = THIS_MODULE,
.name = "usb",
.bus = &usb_bus_type,
.probe = generic_probe,
@@ -159,6 +160,7 @@
new_driver->driver.bus = &usb_bus_type;
new_driver->driver.probe = usb_probe_interface;
new_driver->driver.remove = usb_unbind_interface;
+ new_driver->driver.owner = new_driver->owner;
usb_lock_all_devices();
retval = driver_register(&new_driver->driver);
diff -Nru a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
--- a/drivers/usb/serial/bus.c 2004-09-22 15:56:44 -07:00
+++ b/drivers/usb/serial/bus.c 2004-09-22 15:56:44 -07:00
@@ -120,6 +120,7 @@
device->driver.bus = &usb_serial_bus_type;
device->driver.probe = usb_serial_device_probe;
device->driver.remove = usb_serial_device_remove;
+ device->driver.owner = device->owner;
retval = driver_register(&device->driver);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/