Commit 13f4db9e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: fix __must_check warnings in drivers/usb/serial/

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1ee95216
...@@ -1101,10 +1101,11 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att ...@@ -1101,10 +1101,11 @@ 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(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer);
static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); 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 ftdi_private *priv;
struct usb_device *udev; struct usb_device *udev;
int retval = 0;
dbg("%s",__FUNCTION__); dbg("%s",__FUNCTION__);
...@@ -1115,11 +1116,14 @@ static void create_sysfs_attrs(struct usb_serial *serial) ...@@ -1115,11 +1116,14 @@ static void create_sysfs_attrs(struct usb_serial *serial)
* sysfs parameter, so I'm playing it safe. */ * sysfs parameter, so I'm playing it safe. */
if (priv->chip_type != SIO) { if (priv->chip_type != SIO) {
dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]);
device_create_file(&udev->dev, &dev_attr_event_char); retval = device_create_file(&udev->dev, &dev_attr_event_char);
if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) { if ((!retval) &&
device_create_file(&udev->dev, &dev_attr_latency_timer); (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) static void remove_sysfs_attrs(struct usb_serial *serial)
...@@ -1162,6 +1166,7 @@ static int ftdi_sio_attach (struct usb_serial *serial) ...@@ -1162,6 +1166,7 @@ static int ftdi_sio_attach (struct usb_serial *serial)
struct usb_serial_port *port = serial->port[0]; struct usb_serial_port *port = serial->port[0];
struct ftdi_private *priv; struct ftdi_private *priv;
struct ftdi_sio_quirk *quirk; struct ftdi_sio_quirk *quirk;
int retval;
dbg("%s",__FUNCTION__); dbg("%s",__FUNCTION__);
...@@ -1203,7 +1208,10 @@ static int ftdi_sio_attach (struct usb_serial *serial) ...@@ -1203,7 +1208,10 @@ static int ftdi_sio_attach (struct usb_serial *serial)
usb_set_serial_port_data(serial->port[0], priv); usb_set_serial_port_data(serial->port[0], priv);
ftdi_determine_type (serial->port[0]); 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. */ /* Check for device requiring special set up. */
quirk = (struct ftdi_sio_quirk *)usb_get_serial_data(serial); quirk = (struct ftdi_sio_quirk *)usb_get_serial_data(serial);
...@@ -1211,7 +1219,7 @@ static int ftdi_sio_attach (struct usb_serial *serial) ...@@ -1211,7 +1219,7 @@ static int ftdi_sio_attach (struct usb_serial *serial)
quirk->setup(serial); quirk->setup(serial);
} }
return (0); return 0;
} /* ftdi_sio_attach */ } /* ftdi_sio_attach */
......
...@@ -932,7 +932,10 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -932,7 +932,10 @@ int usb_serial_probe(struct usb_interface *interface,
snprintf (&port->dev.bus_id[0], sizeof(port->dev.bus_id), "ttyUSB%d", port->number); snprintf (&port->dev.bus_id[0], sizeof(port->dev.bus_id), "ttyUSB%d", port->number);
dbg ("%s - registering %s", __FUNCTION__, port->dev.bus_id); dbg ("%s - registering %s", __FUNCTION__, port->dev.bus_id);
device_register (&port->dev); retval = device_register(&port->dev);
if (retval)
dev_err(&port->dev, "Error registering port device, "
"continuing\n");
} }
usb_serial_console_init (debug, minor); usb_serial_console_init (debug, 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