diff mbox series

[8/8] can: etas_es58x and peak_usb: remove useless call to usb_set_intfdata()

Message ID 20221203133159.94414-9-mailhol.vincent@wanadoo.fr
State Superseded
Headers show
Series can: usb: remove all usb_set_intfdata(intf, NULL) in drivers' disconnect() | expand

Commit Message

Vincent MAILHOL Dec. 3, 2022, 1:31 p.m. UTC
The core sets the usb_interface to NULL in [1]. Also setting it to
NULL in usb_driver::disconnect() is useless.

Remove the calls to usb_set_intfdata(intf, NULL) in the disconnect
functions of all drivers under drivers/net/can/usb, namely etas_es58x
and peak_usb.

[1] function usb_unbind_interface() from drivers/usb/core/driver.c
Link: https://elixir.bootlin.com/linux/v6.0/source/drivers/usb/core/driver.c#L497

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/etas_es58x/es58x_core.c  | 1 -
 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 --
 2 files changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c
index 0c7f7505632c..4924f0be3510 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.c
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.c
@@ -2257,7 +2257,6 @@  static void es58x_disconnect(struct usb_interface *intf)
 	es58x_free_netdevs(es58x_dev);
 	es58x_free_urbs(es58x_dev);
 	devlink_free(priv_to_devlink(es58x_dev));
-	usb_set_intfdata(intf, NULL);
 }
 
 static struct usb_driver es58x_driver = {
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index 1d996d3320fe..c15200aebfb6 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -974,8 +974,6 @@  static void peak_usb_disconnect(struct usb_interface *intf)
 		free_candev(netdev);
 		dev_info(&intf->dev, "%s removed\n", name);
 	}
-
-	usb_set_intfdata(intf, NULL);
 }
 
 /*