Commit 96c77e54 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

parent c5a3871c
......@@ -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 @@ static int usb_serial_device_probe (struct device *dev)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment