* [PATCH] clk: qcom: Simplify usage of dev_err_probe()
@ 2021-04-27 16:45 Uwe Kleine-König
2021-04-27 16:56 ` Bjorn Andersson
2021-06-01 23:34 ` Stephen Boyd
0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2021-04-27 16:45 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Michael Turquette, Stephen Boyd
Cc: linux-arm-msm, linux-clk
dev_err_probe() returns the error code passed as second parameter. Also if
the error code is -EPROBE_DEFER dev_err_probe() is silent, so there is no
need to check for this value before calling dev_err_probe().
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
drivers/clk/qcom/apcs-sdx55.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/clk/qcom/apcs-sdx55.c b/drivers/clk/qcom/apcs-sdx55.c
index d0edabebf9c2..6810637f32e3 100644
--- a/drivers/clk/qcom/apcs-sdx55.c
+++ b/drivers/clk/qcom/apcs-sdx55.c
@@ -56,10 +56,8 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
int ret;
regmap = dev_get_regmap(parent, NULL);
- if (!regmap) {
- dev_err_probe(dev, -ENODEV, "Failed to get parent regmap\n");
- return -ENODEV;
- }
+ if (!regmap)
+ return dev_err_probe(dev, -ENODEV, "Failed to get parent regmap\n");
a7cc = devm_kzalloc(dev, sizeof(*a7cc), GFP_KERNEL);
if (!a7cc)
@@ -80,19 +78,15 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
a7cc->parent_map = apcs_mux_clk_parent_map;
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;
- }
+ if (IS_ERR(a7cc->pclk))
+ return dev_err_probe(dev, PTR_ERR(a7cc->pclk),
+ "Failed to get PLL clk\n");
a7cc->clk_nb.notifier_call = a7cc_notifier_cb;
ret = clk_notifier_register(a7cc->pclk, &a7cc->clk_nb);
- if (ret) {
- dev_err_probe(dev, ret, "Failed to register clock notifier\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to register clock notifier\n");
ret = devm_clk_register_regmap(dev, &a7cc->clkr);
if (ret) {
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: qcom: Simplify usage of dev_err_probe()
2021-04-27 16:45 [PATCH] clk: qcom: Simplify usage of dev_err_probe() Uwe Kleine-König
@ 2021-04-27 16:56 ` Bjorn Andersson
2021-05-22 14:56 ` Uwe Kleine-König
2021-06-01 23:34 ` Stephen Boyd
1 sibling, 1 reply; 4+ messages in thread
From: Bjorn Andersson @ 2021-04-27 16:56 UTC (permalink / raw)
To: Uwe Kleine-K?nig
Cc: Andy Gross, Michael Turquette, Stephen Boyd, linux-arm-msm, linux-clk
On Tue 27 Apr 11:45 CDT 2021, Uwe Kleine-K?nig wrote:
> dev_err_probe() returns the error code passed as second parameter. Also if
> the error code is -EPROBE_DEFER dev_err_probe() is silent, so there is no
> need to check for this value before calling dev_err_probe().
>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> ---
> drivers/clk/qcom/apcs-sdx55.c | 22 ++++++++--------------
> 1 file changed, 8 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/clk/qcom/apcs-sdx55.c b/drivers/clk/qcom/apcs-sdx55.c
> index d0edabebf9c2..6810637f32e3 100644
> --- a/drivers/clk/qcom/apcs-sdx55.c
> +++ b/drivers/clk/qcom/apcs-sdx55.c
> @@ -56,10 +56,8 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
> int ret;
>
> regmap = dev_get_regmap(parent, NULL);
> - if (!regmap) {
> - dev_err_probe(dev, -ENODEV, "Failed to get parent regmap\n");
> - return -ENODEV;
> - }
> + if (!regmap)
> + return dev_err_probe(dev, -ENODEV, "Failed to get parent regmap\n");
>
> a7cc = devm_kzalloc(dev, sizeof(*a7cc), GFP_KERNEL);
> if (!a7cc)
> @@ -80,19 +78,15 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
> a7cc->parent_map = apcs_mux_clk_parent_map;
>
> 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;
> - }
> + if (IS_ERR(a7cc->pclk))
> + return dev_err_probe(dev, PTR_ERR(a7cc->pclk),
> + "Failed to get PLL clk\n");
>
> a7cc->clk_nb.notifier_call = a7cc_notifier_cb;
> ret = clk_notifier_register(a7cc->pclk, &a7cc->clk_nb);
> - if (ret) {
> - dev_err_probe(dev, ret, "Failed to register clock notifier\n");
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(dev, ret,
> + "Failed to register clock notifier\n");
>
> ret = devm_clk_register_regmap(dev, &a7cc->clkr);
> if (ret) {
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: qcom: Simplify usage of dev_err_probe()
2021-04-27 16:56 ` Bjorn Andersson
@ 2021-05-22 14:56 ` Uwe Kleine-König
0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2021-05-22 14:56 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd
Cc: Andy Gross, linux-arm-msm, linux-clk
[-- Attachment #1.1: Type: text/plain, Size: 621 bytes --]
Hello,
On 4/27/21 6:56 PM, Bjorn Andersson wrote:
> On Tue 27 Apr 11:45 CDT 2021, Uwe Kleine-K?nig wrote:
@Bjorn Andersson: Your MUA is broken, it misquotes the ö in my name (in
the mail and the To header).
>> dev_err_probe() returns the error code passed as second parameter. Also if
>> the error code is -EPROBE_DEFER dev_err_probe() is silent, so there is
no
>> need to check for this value before calling dev_err_probe().
>>
>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
thanks.
This patch is nearly a month old now. Is drivers/clk still maintained?
Best regards
Uwe
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: qcom: Simplify usage of dev_err_probe()
2021-04-27 16:45 [PATCH] clk: qcom: Simplify usage of dev_err_probe() Uwe Kleine-König
2021-04-27 16:56 ` Bjorn Andersson
@ 2021-06-01 23:34 ` Stephen Boyd
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2021-06-01 23:34 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Michael Turquette, Uwe Kleine-König
Cc: linux-arm-msm, linux-clk
(My MUA probably messed this up)
Quoting Uwe Kleine-König (2021-04-27 09:45:22)
> dev_err_probe() returns the error code passed as second parameter. Also if
> the error code is -EPROBE_DEFER dev_err_probe() is silent, so there is no
> need to check for this value before calling dev_err_probe().
>
> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-01 23:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 16:45 [PATCH] clk: qcom: Simplify usage of dev_err_probe() Uwe Kleine-König
2021-04-27 16:56 ` Bjorn Andersson
2021-05-22 14:56 ` Uwe Kleine-König
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).