From: Salah Triki <salah.triki@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: salah.triki@gmail.com
Subject: [PATCH] drivers: bluetooth: bpa10x: use usb_{get,put}_dev in bpa10x_{probe,disconnect}
Date: Sun, 27 Apr 2025 17:23:26 +0100 [thread overview]
Message-ID: <aA5Z_gOXAwrWDI7E@pc> (raw)
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
next reply other threads:[~2025-04-27 16:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-27 16:23 Salah Triki [this message]
2025-04-27 17:02 ` drivers: bluetooth: bpa10x: use usb_{get,put}_dev in bpa10x_{probe,disconnect} bluez.test.bot
2025-04-27 19:01 ` [PATCH] " Paul Menzel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aA5Z_gOXAwrWDI7E@pc \
--to=salah.triki@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox