[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220723032328.2951275-1-williamsukatube@163.com>
Date: Sat, 23 Jul 2022 11:23:28 +0800
From: williamsukatube@....com
To: agross@...nel.org, bjorn.andersson@...aro.org,
srinivas.kandagatla@...aro.org, linux-arm-msm@...r.kernel.org,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Cc: konrad.dybcio@...ainline.org,
William Dean <williamsukatube@...il.com>,
Hacash Robot <hacashRobot@...tino.com>
Subject: [PATCH] slimbus: qcom-ngd-ctrl: Add check for platform_driver_register
From: William Dean <williamsukatube@...il.com>
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@...tino.com>
Signed-off-by: William Dean <williamsukatube@...il.com>
---
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
Powered by blists - more mailing lists