linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: qcom: cleanup some dev_err_probe() calls
@ 2021-05-11  7:09 Dan Carpenter
  2021-06-01 23:34 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-05-11  7:09 UTC (permalink / raw)
  To: Andy Gross
  Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, linux-arm-msm,
	linux-clk, linux-kernel, kernel-janitors

The dev_err_probe() function prints an error message if the error
code is not -EPROBE_DEFER.  If we know the error code in is -ENODEV
then there is no reason to check.  Conversely, we do not need to
check for -EPROBE_DEFER before calling.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/clk/qcom/apcs-sdx55.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/qcom/apcs-sdx55.c b/drivers/clk/qcom/apcs-sdx55.c
index d0edabebf9c2..ee3fbe755f72 100644
--- a/drivers/clk/qcom/apcs-sdx55.c
+++ b/drivers/clk/qcom/apcs-sdx55.c
@@ -57,7 +57,7 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
 
 	regmap = dev_get_regmap(parent, NULL);
 	if (!regmap) {
-		dev_err_probe(dev, -ENODEV, "Failed to get parent regmap\n");
+		dev_err(dev, "Failed to get parent regmap\n");
 		return -ENODEV;
 	}
 
@@ -82,9 +82,7 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
 	a7cc->pclk = devm_clk_get(parent, "pll");
 	if (IS_ERR(a7cc->pclk)) {
 		ret = PTR_ERR(a7cc->pclk);
-		if (ret != -EPROBE_DEFER)
-			dev_err_probe(dev, ret, "Failed to get PLL clk\n");
-		return ret;
+		return dev_err_probe(dev, ret, "Failed to get PLL clk\n");
 	}
 
 	a7cc->clk_nb.notifier_call = a7cc_notifier_cb;
-- 
2.30.2

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

* Re: [PATCH] clk: qcom: cleanup some dev_err_probe() calls
  2021-05-11  7:09 [PATCH] clk: qcom: cleanup some dev_err_probe() calls Dan Carpenter
@ 2021-06-01 23:34 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2021-06-01 23:34 UTC (permalink / raw)
  To: Andy Gross, Dan Carpenter
  Cc: Bjorn Andersson, Michael Turquette, linux-arm-msm, linux-clk,
	linux-kernel, kernel-janitors

Quoting Dan Carpenter (2021-05-11 00:09:08)
> The dev_err_probe() function prints an error message if the error
> code is not -EPROBE_DEFER.  If we know the error code in is -ENODEV
> then there is no reason to check.  Conversely, we do not need to
> check for -EPROBE_DEFER before calling.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---

Applied to clk-next with some manual effort

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

end of thread, other threads:[~2021-06-01 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11  7:09 [PATCH] clk: qcom: cleanup some dev_err_probe() calls Dan Carpenter
2021-06-01 23:34 ` Stephen Boyd

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).