ChangeSet 1.879.84.2, 2003/01/14 17:49:55-08:00, [EMAIL PROTECTED]

[PATCH] USB: add dev attribute for usb-serial devices in sysfs


diff -Nru a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
--- a/drivers/usb/serial/bus.c  Wed Jan 15 14:59:34 2003
+++ b/drivers/usb/serial/bus.c  Wed Jan 15 14:59:34 2003
@@ -23,6 +23,17 @@
 
 #include "usb-serial.h"
 
+static ssize_t show_dev (struct device *dev, char *buf)
+{
+       struct usb_serial_port *port= to_usb_serial_port(dev);
+       dev_t base;
+
+       port = to_usb_serial_port(dev);
+
+       base = MKDEV(SERIAL_TTY_MAJOR, port->number);
+       return sprintf(buf, "%04x\n", base);
+}
+static DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
 
 static int usb_serial_device_match (struct device *dev, struct device_driver *drv)
 {
@@ -79,6 +90,8 @@
        minor = port->number;
 
        tty_register_device (&usb_serial_tty_driver, minor);
+       device_create_file (dev, &dev_attr_dev);
+
        dev_info(&port->serial->dev->dev, 
                 "%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)\n",
                 driver->name, minor, minor);



-------------------------------------------------------
This SF.NET email is sponsored by: A Thawte Code Signing Certificate 
is essential in establishing user confidence by providing assurance of 
authenticity and code integrity. Download our Free Code Signing guide:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to