All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iBluetooth: hci_intel: Add check for platform_driver_register
@ 2022-05-31  3:32 Jiasheng Jiang
  2022-05-31  4:30 ` bluez.test.bot
  2022-06-02 15:40 ` [PATCH] " Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Jiasheng Jiang @ 2022-05-31  3:32 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz
  Cc: linux-bluetooth, linux-kernel, Jiasheng Jiang

As platform_driver_register() could fail, it should be better
to deal with the return value in order to maintain the code
consisitency.

Fixes: 1ab1f239bf17 ("Bluetooth: hci_intel: Add support for platform driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 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 7249b91d9b91..d4801b26cc8e 100644
--- a/drivers/bluetooth/hci_intel.c
+++ b/drivers/bluetooth/hci_intel.c
@@ -1217,7 +1217,11 @@ static struct platform_driver intel_driver = {
 
 int __init intel_init(void)
 {
-	platform_driver_register(&intel_driver);
+	int ret;
+
+	ret = platform_driver_register(&intel_driver);
+	if (ret)
+		return ret;
 
 	return hci_uart_register_proto(&intel_proto);
 }
-- 
2.25.1


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

* RE: iBluetooth: hci_intel: Add check for platform_driver_register
  2022-05-31  3:32 [PATCH] iBluetooth: hci_intel: Add check for platform_driver_register Jiasheng Jiang
@ 2022-05-31  4:30 ` bluez.test.bot
  2022-06-02 15:40 ` [PATCH] " Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-05-31  4:30 UTC (permalink / raw)
  To: linux-bluetooth, jiasheng

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=646117

---Test result---

Test Summary:
CheckPatch                    PASS      1.34 seconds
GitLint                       PASS      0.82 seconds
SubjectPrefix                 PASS      0.65 seconds
BuildKernel                   PASS      31.17 seconds
BuildKernel32                 PASS      28.05 seconds
Incremental Build with patchesPASS      38.45 seconds
TestRunner: Setup             PASS      474.59 seconds
TestRunner: l2cap-tester      PASS      17.13 seconds
TestRunner: bnep-tester       PASS      5.99 seconds
TestRunner: mgmt-tester       PASS      101.65 seconds
TestRunner: rfcomm-tester     PASS      9.53 seconds
TestRunner: sco-tester        PASS      9.37 seconds
TestRunner: smp-tester        PASS      9.39 seconds
TestRunner: userchan-tester   PASS      6.38 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH] iBluetooth: hci_intel: Add check for platform_driver_register
  2022-05-31  3:32 [PATCH] iBluetooth: hci_intel: Add check for platform_driver_register Jiasheng Jiang
  2022-05-31  4:30 ` bluez.test.bot
@ 2022-06-02 15:40 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2022-06-02 15:40 UTC (permalink / raw)
  To: Jiasheng Jiang
  Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth, linux-kernel

Hi Jiasheng,

> As platform_driver_register() could fail, it should be better
> to deal with the return value in order to maintain the code
> consisitency.
> 
> Fixes: 1ab1f239bf17 ("Bluetooth: hci_intel: Add support for platform driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> 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 7249b91d9b91..d4801b26cc8e 100644
> --- a/drivers/bluetooth/hci_intel.c
> +++ b/drivers/bluetooth/hci_intel.c
> @@ -1217,7 +1217,11 @@ static struct platform_driver intel_driver = {
> 
> int __init intel_init(void)
> {
> -	platform_driver_register(&intel_driver);
> +	int ret;
> +
> +	ret = platform_driver_register(&intel_driver);
> +	if (ret)
> +		return ret;

most of the driver uses int err. So please do that as well.

Regards

Marcel


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

end of thread, other threads:[~2022-06-02 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31  3:32 [PATCH] iBluetooth: hci_intel: Add check for platform_driver_register Jiasheng Jiang
2022-05-31  4:30 ` bluez.test.bot
2022-06-02 15:40 ` [PATCH] " Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.