diff options
Diffstat (limited to 'drivers/usb/serial/bus.c')
-rw-r--r-- | drivers/usb/serial/bus.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index 5d8d86666b90..6f91eb9ae81a 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c | |||
@@ -51,6 +51,7 @@ static int usb_serial_device_probe(struct device *dev) | |||
51 | { | 51 | { |
52 | struct usb_serial_driver *driver; | 52 | struct usb_serial_driver *driver; |
53 | struct usb_serial_port *port; | 53 | struct usb_serial_port *port; |
54 | struct device *tty_dev; | ||
54 | int retval = 0; | 55 | int retval = 0; |
55 | int minor; | 56 | int minor; |
56 | 57 | ||
@@ -80,7 +81,15 @@ static int usb_serial_device_probe(struct device *dev) | |||
80 | } | 81 | } |
81 | 82 | ||
82 | minor = port->minor; | 83 | minor = port->minor; |
83 | tty_register_device(usb_serial_tty_driver, minor, dev); | 84 | tty_dev = tty_register_device(usb_serial_tty_driver, minor, dev); |
85 | if (IS_ERR(tty_dev)) { | ||
86 | retval = PTR_ERR(tty_dev); | ||
87 | device_remove_file(dev, &dev_attr_port_number); | ||
88 | if (driver->port_remove) | ||
89 | driver->port_remove(port); | ||
90 | goto exit_with_autopm; | ||
91 | } | ||
92 | |||
84 | dev_info(&port->serial->dev->dev, | 93 | dev_info(&port->serial->dev->dev, |
85 | "%s converter now attached to ttyUSB%d\n", | 94 | "%s converter now attached to ttyUSB%d\n", |
86 | driver->description, minor); | 95 | driver->description, minor); |