wifi: ath6kl: 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>
Link: https://patch.msgid.link/20260306085144.12064-2-johan@kernel.org
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
Johan Hovold 2026-03-06 09:51:27 +01:00 committed by Jeff Johnson
parent 8e0ab5b9ad
commit 86581adf05

View File

@ -1124,8 +1124,6 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
int vendor_id, product_id;
int ret = 0;
usb_get_dev(dev);
vendor_id = le16_to_cpu(dev->descriptor.idVendor);
product_id = le16_to_cpu(dev->descriptor.idProduct);
@ -1143,11 +1141,8 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
ath6kl_dbg(ATH6KL_DBG_USB, "USB 1.1 Host\n");
ar_usb = ath6kl_usb_create(interface);
if (ar_usb == NULL) {
ret = -ENOMEM;
goto err_usb_put;
}
if (ar_usb == NULL)
return -ENOMEM;
ar = ath6kl_core_create(&ar_usb->udev->dev);
if (ar == NULL) {
@ -1176,15 +1171,12 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
ath6kl_core_destroy(ar);
err_usb_destroy:
ath6kl_usb_destroy(ar_usb);
err_usb_put:
usb_put_dev(dev);
return ret;
}
static void ath6kl_usb_remove(struct usb_interface *interface)
{
usb_put_dev(interface_to_usbdev(interface));
ath6kl_usb_device_detached(interface);
}