* [PATCH] bluetooth: hci_intel: Check for driver register failure
@ 2018-12-28 19:53 Aditya Pakki
2019-01-18 11:00 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2018-12-28 19:53 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_intel.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c
index f31410526c57..8450389a2017 100644
--- a/drivers/bluetooth/hci_intel.c
+++ b/drivers/bluetooth/hci_intel.c
@@ -1242,7 +1242,11 @@ static struct platform_driver intel_driver = {
int __init intel_init(void)
{
- platform_driver_register(&intel_driver);
+ int rc;
+
+ rc = platform_driver_register(&intel_driver);
+ if (rc)
+ return rc;
return hci_uart_register_proto(&intel_proto);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bluetooth: hci_intel: Check for driver register failure
2018-12-28 19:53 [PATCH] bluetooth: hci_intel: Check for driver register failure Aditya Pakki
@ 2019-01-18 11:00 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-01-18 11:00 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_intel.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c
> index f31410526c57..8450389a2017 100644
> --- a/drivers/bluetooth/hci_intel.c
> +++ b/drivers/bluetooth/hci_intel.c
> @@ -1242,7 +1242,11 @@ static struct platform_driver intel_driver = {
>
> int __init intel_init(void)
> {
> - platform_driver_register(&intel_driver);
> + int rc;
> +
> + rc = platform_driver_register(&intel_driver);
> + if (rc)
> + return rc;
same here. Let this fail since even if it fails, the rest of the driver will be still functioning.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-18 11:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-28 19:53 [PATCH] bluetooth: hci_intel: Check for driver register failure Aditya Pakki
2019-01-18 11:00 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).