Commit c5d1448f authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Johan Hovold
Browse files

USB: serial: make remove callback return void



All usb_serial drivers return 0 in their remove callbacks and driver
core ignores the value returned by usb_serial_device_remove(). So change
the remove callback to return void and return 0 unconditionally in
usb_serial_device_remove().

Signed-off-by: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
Link: https://lore.kernel.org/r/20210208143149.963644-2-uwe@kleine-koenig.org


Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent a54af1b7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -178,15 +178,13 @@ static int ark3116_port_probe(struct usb_serial_port *port)
	return 0;
}

static int ark3116_port_remove(struct usb_serial_port *port)
static void ark3116_port_remove(struct usb_serial_port *port)
{
	struct ark3116_private *priv = usb_get_serial_port_data(port);

	/* device is closed, so URBs and DMA should be down */
	mutex_destroy(&priv->hw_lock);
	kfree(priv);

	return 0;
}

static void ark3116_set_termios(struct tty_struct *tty,
+2 −4
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@

/* function prototypes for a Belkin USB Serial Adapter F5U103 */
static int belkin_sa_port_probe(struct usb_serial_port *port);
static int belkin_sa_port_remove(struct usb_serial_port *port);
static void belkin_sa_port_remove(struct usb_serial_port *port);
static int  belkin_sa_open(struct tty_struct *tty,
			struct usb_serial_port *port);
static void belkin_sa_close(struct usb_serial_port *port);
@@ -134,14 +134,12 @@ static int belkin_sa_port_probe(struct usb_serial_port *port)
	return 0;
}

static int belkin_sa_port_remove(struct usb_serial_port *port)
static void belkin_sa_port_remove(struct usb_serial_port *port)
{
	struct belkin_sa_private *priv;

	priv = usb_get_serial_port_data(port);
	kfree(priv);

	return 0;
}

static int belkin_sa_open(struct tty_struct *tty,
+2 −3
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@ static int usb_serial_device_remove(struct device *dev)
{
	struct usb_serial_port *port = to_usb_serial_port(dev);
	struct usb_serial_driver *driver;
	int retval = 0;
	int minor;
	int autopm_err;

@@ -105,7 +104,7 @@ static int usb_serial_device_remove(struct device *dev)

	driver = port->serial->type;
	if (driver->port_remove)
		retval = driver->port_remove(port);
		driver->port_remove(port);

	dev_info(dev, "%s converter now disconnected from ttyUSB%d\n",
		 driver->description, minor);
@@ -113,7 +112,7 @@ static int usb_serial_device_remove(struct device *dev)
	if (!autopm_err)
		usb_autopm_put_interface(port->serial->interface);

	return retval;
	return 0;
}

static ssize_t new_id_store(struct device_driver *driver,
+1 −3
Original line number Diff line number Diff line
@@ -419,14 +419,12 @@ error: kfree(priv);
	return r;
}

static int ch341_port_remove(struct usb_serial_port *port)
static void ch341_port_remove(struct usb_serial_port *port)
{
	struct ch341_private *priv;

	priv = usb_get_serial_port_data(port);
	kfree(priv);

	return 0;
}

static int ch341_carrier_raised(struct usb_serial_port *port)
+2 −4
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ static int cp210x_attach(struct usb_serial *);
static void cp210x_disconnect(struct usb_serial *);
static void cp210x_release(struct usb_serial *);
static int cp210x_port_probe(struct usb_serial_port *);
static int cp210x_port_remove(struct usb_serial_port *);
static void cp210x_port_remove(struct usb_serial_port *);
static void cp210x_dtr_rts(struct usb_serial_port *port, int on);
static void cp210x_process_read_urb(struct urb *urb);
static void cp210x_enable_event_mode(struct usb_serial_port *port);
@@ -1841,14 +1841,12 @@ static int cp210x_port_probe(struct usb_serial_port *port)
	return 0;
}

static int cp210x_port_remove(struct usb_serial_port *port)
static void cp210x_port_remove(struct usb_serial_port *port)
{
	struct cp210x_port_private *port_priv;

	port_priv = usb_get_serial_port_data(port);
	kfree(port_priv);

	return 0;
}

static void cp210x_init_max_speed(struct usb_serial *serial)
Loading