Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btwilink: Fix probe return value
@ 2016-10-20  7:05 Jacob Siverskog
  2016-10-20  8:17 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Jacob Siverskog @ 2016-10-20  7:05 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Jacob Siverskog

Probe functions should return 0 on success. This driver's probe
returns the value returned by hci_register_dev(), which is the hci
index. This works for systems with only one hci device (id = 0) but
for systems where the btwilink device ends up with an id larger than
0, things will start to fall apart.

Make the probe function return 0 on success.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
---
 drivers/bluetooth/btwilink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c
index ef51c9c..b6bb58c 100644
--- a/drivers/bluetooth/btwilink.c
+++ b/drivers/bluetooth/btwilink.c
@@ -310,7 +310,7 @@ static int bt_ti_probe(struct platform_device *pdev)
 	BT_DBG("HCI device registered (hdev %p)", hdev);
 
 	dev_set_drvdata(&pdev->dev, hst);
-	return err;
+	return 0;
 }
 
 static int bt_ti_remove(struct platform_device *pdev)
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: btwilink: Fix probe return value
  2016-10-20  7:05 [PATCH] Bluetooth: btwilink: Fix probe return value Jacob Siverskog
@ 2016-10-20  8:17 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2016-10-20  8:17 UTC (permalink / raw)
  To: Jacob Siverskog
  Cc: open list:BLUETOOTH DRIVERS, Gustavo F. Padovan, Johan Hedberg

Hi Jacob,

> Probe functions should return 0 on success. This driver's probe
> returns the value returned by hci_register_dev(), which is the hci
> index. This works for systems with only one hci device (id = 0) but
> for systems where the btwilink device ends up with an id larger than
> 0, things will start to fall apart.
> 
> Make the probe function return 0 on success.
> 
> Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
> ---
> drivers/bluetooth/btwilink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-stable tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-20  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-20  7:05 [PATCH] Bluetooth: btwilink: Fix probe return value Jacob Siverskog
2016-10-20  8:17 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox