[PATCH] slimbus: qcom-ngd-ctrl: Add check for platform_driver_register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: William Dean <williamsukatube@xxxxxxxxx>

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

Fixes: 1830dad34c070 ("slimbus: ngd: register ngd driver only once.")
Reported-by: Hacash Robot <hacashRobot@xxxxxxxxxxx>
Signed-off-by: William Dean <williamsukatube@xxxxxxxxx>
---
 drivers/slimbus/qcom-ngd-ctrl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index 0aa8408464ad..a31ec00a37ac 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1585,7 +1585,12 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)
 		return PTR_ERR(pds);
 	}
 
-	platform_driver_register(&qcom_slim_ngd_driver);
+	ret = platform_driver_register(&qcom_slim_ngd_driver);
+	if (ret) {
+		dev_err(dev, "platform driver register failed: %d\n", ret);
+		return ret;
+	}
+
 	return of_qcom_slim_ngd_register(dev, ctrl);
 }
 
-- 
2.25.1




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux