mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-18 11:17:07 +00:00
USB: serial: drop if with an always false condition
In a bus remove function the passed device is always valid, so there is no need to check for it being NULL. (Side note: The check for port being non-NULL is broken anyhow, because to_usb_serial_port() is a wrapper around container_of() for a member that is not the first one. So port can hardly become NULL.) Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Link: https://lore.kernel.org/r/20210208143149.963644-1-uwe@kleine-koenig.org Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
6420a56950
commit
a54af1b7d6
@ -86,16 +86,12 @@ err_autopm_put:
|
||||
|
||||
static int usb_serial_device_remove(struct device *dev)
|
||||
{
|
||||
struct usb_serial_port *port = to_usb_serial_port(dev);
|
||||
struct usb_serial_driver *driver;
|
||||
struct usb_serial_port *port;
|
||||
int retval = 0;
|
||||
int minor;
|
||||
int autopm_err;
|
||||
|
||||
port = to_usb_serial_port(dev);
|
||||
if (!port)
|
||||
return -ENODEV;
|
||||
|
||||
/*
|
||||
* Make sure suspend/resume doesn't race against port_remove.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user