ieee802154: atusb: drop redundant device reference

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Link: https://patch.msgid.link/20260305104313.15898-1-johan@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Johan Hovold
2026-03-05 11:43:13 +01:00
committed by Jakub Kicinski
parent ad6b67ffd2
commit 4e9b1994a1

View File

@@ -961,7 +961,7 @@ static int atusb_probe(struct usb_interface *interface,
atusb = hw->priv;
atusb->hw = hw;
atusb->usb_dev = usb_get_dev(usb_dev);
atusb->usb_dev = usb_dev;
usb_set_intfdata(interface, atusb);
atusb->shutdown = 0;
@@ -1055,7 +1055,6 @@ fail:
atusb_free_urbs(atusb);
usb_kill_urb(atusb->tx_urb);
usb_free_urb(atusb->tx_urb);
usb_put_dev(usb_dev);
ieee802154_free_hw(hw);
return ret;
}
@@ -1076,8 +1075,6 @@ static void atusb_disconnect(struct usb_interface *interface)
ieee802154_unregister_hw(atusb->hw);
usb_put_dev(atusb->usb_dev);
ieee802154_free_hw(atusb->hw);
usb_set_intfdata(interface, NULL);