wifi: mt76: mt792xu: 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/20260430083335.215239-5-johan@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Johan Hovold 2026-04-30 10:33:34 +02:00 committed by Felix Fietkau
parent 70a05728db
commit d246ff8e59
3 changed files with 0 additions and 5 deletions

View File

@ -197,7 +197,6 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
dev->fw_features = features;
dev->hif_ops = &hif_ops;
udev = usb_get_dev(udev);
usb_reset_device(udev);
usb_set_intfdata(usb_intf, dev);
@ -246,7 +245,6 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
mt76u_queues_deinit(&dev->mt76);
usb_set_intfdata(usb_intf, NULL);
usb_put_dev(interface_to_usbdev(usb_intf));
mt76_free_device(&dev->mt76);

View File

@ -185,7 +185,6 @@ static int mt7925u_probe(struct usb_interface *usb_intf,
dev->fw_features = features;
dev->hif_ops = &hif_ops;
udev = usb_get_dev(udev);
usb_reset_device(udev);
usb_set_intfdata(usb_intf, dev);
@ -234,7 +233,6 @@ static int mt7925u_probe(struct usb_interface *usb_intf,
mt76u_queues_deinit(&dev->mt76);
usb_set_intfdata(usb_intf, NULL);
usb_put_dev(interface_to_usbdev(usb_intf));
mt76_free_device(&dev->mt76);

View File

@ -341,7 +341,6 @@ void mt792xu_disconnect(struct usb_interface *usb_intf)
mt792xu_cleanup(dev);
usb_set_intfdata(usb_intf, NULL);
usb_put_dev(interface_to_usbdev(usb_intf));
mt76_free_device(&dev->mt76);
}