wifi: ath10k: 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-5-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:30 +01:00 committed by Jeff Johnson
parent 2ddbec82e1
commit c880c07940

View File

@ -1016,7 +1016,6 @@ static int ath10k_usb_probe(struct usb_interface *interface,
netif_napi_add(ar->napi_dev, &ar->napi, ath10k_usb_napi_poll);
usb_get_dev(dev);
vendor_id = le16_to_cpu(dev->descriptor.idVendor);
product_id = le16_to_cpu(dev->descriptor.idProduct);
@ -1055,8 +1054,6 @@ static int ath10k_usb_probe(struct usb_interface *interface,
err:
ath10k_core_destroy(ar);
usb_put_dev(dev);
return ret;
}
@ -1071,7 +1068,6 @@ static void ath10k_usb_remove(struct usb_interface *interface)
ath10k_core_unregister(ar_usb->ar);
netif_napi_del(&ar_usb->ar->napi);
ath10k_usb_destroy(ar_usb->ar);
usb_put_dev(interface_to_usbdev(interface));
ath10k_core_destroy(ar_usb->ar);
}