11 #include <linux/kernel.h>
12 #include <linux/errno.h>
13 #include <linux/tty.h>
14 #include <linux/slab.h>
15 #include <linux/module.h>
19 static int usb_serial_device_match(
struct device *
dev,
35 if (driver == port->
serial->type)
51 static int usb_serial_device_probe(
struct device *dev)
65 retval = usb_autopm_get_interface(port->
serial->interface);
69 driver = port->
serial->type;
73 goto exit_with_autopm;
80 goto exit_with_autopm;
86 "%s converter now attached to ttyUSB%d\n",
90 usb_autopm_put_interface(port->
serial->interface);
95 static int usb_serial_device_remove(
struct device *dev)
107 usb_autopm_get_interface(port->
serial->interface);
111 driver = port->
serial->type;
117 dev_info(dev,
"%s converter now disconnected from ttyUSB%d\n",
120 usb_autopm_put_interface(port->
serial->interface);
124 #ifdef CONFIG_HOTPLUG
129 ssize_t retval = usb_store_new_id(&usb_drv->
dynids, driver, buf, count);
132 retval = usb_store_new_id(&usb_drv->
usb_driver->dynids,
142 return usb_show_dynids(&usb_drv->
dynids, buf);
152 struct usb_dynid *dynid, *
n;
154 spin_lock(&drv->
dynids.lock);
159 spin_unlock(&drv->
dynids.lock);
172 .name =
"usb-serial",
173 .match = usb_serial_device_match,
174 .probe = usb_serial_device_probe,
175 .remove = usb_serial_device_remove,
185 INIT_LIST_HEAD(&driver->
dynids.list);