Linux-Bluetooth Archive on lore.kernel.org
 help / Atom feed
* [PATCH] bluetooth: hci_bcm: Check for driver_register failure
@ 2018-12-28 19:48 Aditya Pakki
  2019-01-18 10:59 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2018-12-28 19:48 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Marcel Holtmann, Johan Hedberg, linux-bluetooth, linux-kernel

While initializing the driver, the function platform_driver_register can
fail and return an error. Consistent with other invocations, this patch
returns the error upstream.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 drivers/bluetooth/hci_bcm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index ddbe518c3e5b..f5ddb0f19c31 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -1442,7 +1442,12 @@ int __init bcm_init(void)
 	/* For now, we need to keep both platform device
 	 * driver (ACPI generated) and serdev driver (DT).
 	 */
-	platform_driver_register(&bcm_driver);
+	int rc;
+
+	rc = platform_driver_register(&bcm_driver);
+	if (rc)
+		return rc;
+
 	serdev_device_driver_register(&bcm_serdev_driver);
 
 	return hci_uart_register_proto(&bcm_proto);
-- 
2.17.1


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

* Re: [PATCH] bluetooth: hci_bcm: Check for driver_register failure
  2018-12-28 19:48 [PATCH] bluetooth: hci_bcm: Check for driver_register failure Aditya Pakki
@ 2019-01-18 10:59 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-01-18 10:59 UTC (permalink / raw)
  To: Aditya Pakki; +Cc: kjlu, Johan Hedberg, linux-bluetooth, linux-kernel

Hi Aditya,

> While initializing the driver, the function platform_driver_register can
> fail and return an error. Consistent with other invocations, this patch
> returns the error upstream.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
> drivers/bluetooth/hci_bcm.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
> index ddbe518c3e5b..f5ddb0f19c31 100644
> --- a/drivers/bluetooth/hci_bcm.c
> +++ b/drivers/bluetooth/hci_bcm.c
> @@ -1442,7 +1442,12 @@ int __init bcm_init(void)
> 	/* For now, we need to keep both platform device
> 	 * driver (ACPI generated) and serdev driver (DT).
> 	 */
> -	platform_driver_register(&bcm_driver);
> +	int rc;
> +
> +	rc = platform_driver_register(&bcm_driver);
> +	if (rc)
> +		return rc;
> +

actually I am fine with ignoring the error here since the usage of a platform device should be removed at some point. It was sort of a hack before we had proper ACPI integration and serdev support.

Regards

Marcel


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-28 19:48 [PATCH] bluetooth: hci_bcm: Check for driver_register failure Aditya Pakki
2019-01-18 10:59 ` Marcel Holtmann

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox