diff options
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index c6115aa1b44..e774a27c6c9 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -344,6 +344,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) }, { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2104_PID) }, + { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2106_PID) }, { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_1_PID) }, { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_2_PID) }, { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_1_PID) }, @@ -507,6 +508,9 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, { USB_DEVICE(TESTO_VID, TESTO_USB_INTERFACE_PID) }, { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, { }, /* Optional parameter entry */ { } /* Terminating entry */ }; @@ -1101,25 +1105,29 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer); static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); -static void create_sysfs_attrs(struct usb_serial *serial) -{ +static int create_sysfs_attrs(struct usb_serial *serial) +{ struct ftdi_private *priv; struct usb_device *udev; + int retval = 0; dbg("%s",__FUNCTION__); - + priv = usb_get_serial_port_data(serial->port[0]); udev = serial->dev; - + /* XXX I've no idea if the original SIO supports the event_char * sysfs parameter, so I'm playing it safe. */ if (priv->chip_type != SIO) { dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); - device_create_file(&udev->dev, &dev_attr_event_char); - if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) { - device_create_file(&udev->dev, &dev_attr_latency_timer); + retval = device_create_file(&udev->dev, &dev_attr_event_char); + if ((!retval) && + (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) { + retval = device_create_file(&udev->dev, + &dev_attr_latency_timer); } } + return retval; } static void remove_sysfs_attrs(struct usb_serial *serial) @@ -1162,7 +1170,8 @@ static int ftdi_sio_attach (struct usb_serial *serial) struct usb_serial_port *port = serial->port[0]; struct ftdi_private *priv; struct ftdi_sio_quirk *quirk; - + int retval; + dbg("%s",__FUNCTION__); priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); @@ -1203,15 +1212,18 @@ static int ftdi_sio_attach (struct usb_serial *serial) usb_set_serial_port_data(serial->port[0], priv); ftdi_determine_type (serial->port[0]); - create_sysfs_attrs(serial); + retval = create_sysfs_attrs(serial); + if (retval) + dev_err(&serial->dev->dev, "Error creating sysfs files, " + "continuing\n"); /* Check for device requiring special set up. */ quirk = (struct ftdi_sio_quirk *)usb_get_serial_data(serial); if (quirk && quirk->setup) { quirk->setup(serial); } - - return (0); + + return 0; } /* ftdi_sio_attach */ |