* [PATCH] drivers: bluetooth: bpa10x: use usb_{get,put}_dev in bpa10x_{probe,disconnect}
@ 2025-04-27 16:23 Salah Triki
2025-04-27 19:01 ` Paul Menzel
0 siblings, 1 reply; 2+ messages in thread
From: Salah Triki @ 2025-04-27 16:23 UTC (permalink / raw)
To: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth,
linux-kernel
Cc: salah.triki
Use usb_{get,put}_dev() to update the ref count of udev.
Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
drivers/bluetooth/bpa10x.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 1fa58c059cbf..0b9931311a59 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -375,7 +375,7 @@ static int bpa10x_probe(struct usb_interface *intf,
if (!data)
return -ENOMEM;
- data->udev = interface_to_usbdev(intf);
+ data->udev = usb_get_dev(interface_to_usbdev(intf));
init_usb_anchor(&data->tx_anchor);
init_usb_anchor(&data->rx_anchor);
@@ -422,6 +422,8 @@ static void bpa10x_disconnect(struct usb_interface *intf)
usb_set_intfdata(intf, NULL);
+ usb_put_dev(data->udev);
+
hci_unregister_dev(data->hdev);
hci_free_dev(data->hdev);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers: bluetooth: bpa10x: use usb_{get,put}_dev in bpa10x_{probe,disconnect}
2025-04-27 16:23 [PATCH] drivers: bluetooth: bpa10x: use usb_{get,put}_dev in bpa10x_{probe,disconnect} Salah Triki
@ 2025-04-27 19:01 ` Paul Menzel
0 siblings, 0 replies; 2+ messages in thread
From: Paul Menzel @ 2025-04-27 19:01 UTC (permalink / raw)
To: Salah Triki
Cc: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth,
linux-kernel
Dear Salah,
Thank you for your patch.
Am 27.04.25 um 18:23 schrieb Salah Triki:
> Use usb_{get,put}_dev() to update the ref count of udev.
Could you please add why that is better?
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> ---
> drivers/bluetooth/bpa10x.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
> index 1fa58c059cbf..0b9931311a59 100644
> --- a/drivers/bluetooth/bpa10x.c
> +++ b/drivers/bluetooth/bpa10x.c
> @@ -375,7 +375,7 @@ static int bpa10x_probe(struct usb_interface *intf,
> if (!data)
> return -ENOMEM;
>
> - data->udev = interface_to_usbdev(intf);
> + data->udev = usb_get_dev(interface_to_usbdev(intf));
>
> init_usb_anchor(&data->tx_anchor);
> init_usb_anchor(&data->rx_anchor);
> @@ -422,6 +422,8 @@ static void bpa10x_disconnect(struct usb_interface *intf)
>
> usb_set_intfdata(intf, NULL);
>
> + usb_put_dev(data->udev);
> +
> hci_unregister_dev(data->hdev);
>
> hci_free_dev(data->hdev);
Kind regards,
Paul
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-27 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-27 16:23 [PATCH] drivers: bluetooth: bpa10x: use usb_{get,put}_dev in bpa10x_{probe,disconnect} Salah Triki
2025-04-27 19:01 ` Paul Menzel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox