[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <5F10A419-10F3-47F2-A83A-F559073F9F77@holtmann.org>
Date: Fri, 18 Jan 2019 12:00:03 +0100
From: Marcel Holtmann <marcel@...tmann.org>
To: Aditya Pakki <pakki001@....edu>
Cc: kjlu@....edu, Johan Hedberg <johan.hedberg@...il.com>,
linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bluetooth: hci_intel: Check for driver register failure
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@....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
Powered by blists - more mailing lists