* [PATCH 2/6] pwm: jz4740: Simplify with dev_err_probe()
2020-08-26 14:47 [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2020-08-26 14:47 ` Krzysztof Kozlowski
2020-09-02 7:12 ` Uwe Kleine-König
2020-08-26 14:47 ` [PATCH 3/6] pwm: rockchip: " Krzysztof Kozlowski
` (6 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-26 14:47 UTC (permalink / raw)
To: Thierry Reding, Uwe Kleine-König, Lee Jones,
Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
bcm-kernel-feedback-list, Paul Cercueil, Heiko Stuebner,
Palmer Dabbelt, Paul Walmsley, Orson Zhai, Baolin Wang,
Chunyan Zhang, Maxime Ripard, Chen-Yu Tsai, linux-pwm,
linux-rpi-kernel, linux-arm-kernel, linux-kernel, linux-rockchip,
linux-riscv
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/pwm/pwm-jz4740.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
index 5830ac2bdf6a..00c642fa2eed 100644
--- a/drivers/pwm/pwm-jz4740.c
+++ b/drivers/pwm/pwm-jz4740.c
@@ -60,12 +60,9 @@ static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
snprintf(name, sizeof(name), "timer%u", pwm->hwpwm);
clk = clk_get(chip->dev, name);
- if (IS_ERR(clk)) {
- if (PTR_ERR(clk) != -EPROBE_DEFER)
- dev_err(chip->dev, "Failed to get clock: %pe", clk);
-
- return PTR_ERR(clk);
- }
+ if (IS_ERR(clk))
+ return dev_err_probe(chip->dev, PTR_ERR(clk),
+ "Failed to get clock\n");
err = clk_prepare_enable(clk);
if (err < 0) {
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 2/6] pwm: jz4740: Simplify with dev_err_probe()
2020-08-26 14:47 ` [PATCH 2/6] pwm: jz4740: " Krzysztof Kozlowski
@ 2020-09-02 7:12 ` Uwe Kleine-König
0 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2020-09-02 7:12 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Heiko Stuebner, Paul Cercueil, Thierry Reding, linux-riscv,
Lee Jones, Florian Fainelli, Chunyan Zhang, linux-rockchip,
Chen-Yu Tsai, bcm-kernel-feedback-list, Orson Zhai, linux-pwm,
Ray Jui, Maxime Ripard, linux-rpi-kernel, Paul Walmsley,
linux-arm-kernel, Scott Branden, linux-kernel, Palmer Dabbelt,
Baolin Wang, Nicolas Saenz Julienne
[-- Attachment #1.1: Type: text/plain, Size: 502 bytes --]
On Wed, Aug 26, 2020 at 04:47:43PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/6] pwm: rockchip: Simplify with dev_err_probe()
2020-08-26 14:47 [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-08-26 14:47 ` [PATCH 2/6] pwm: jz4740: " Krzysztof Kozlowski
@ 2020-08-26 14:47 ` Krzysztof Kozlowski
2020-09-02 7:13 ` Uwe Kleine-König
2020-08-26 14:47 ` [PATCH 4/6] pwm: sifive: " Krzysztof Kozlowski
` (5 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-26 14:47 UTC (permalink / raw)
To: Thierry Reding, Uwe Kleine-König, Lee Jones,
Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
bcm-kernel-feedback-list, Paul Cercueil, Heiko Stuebner,
Palmer Dabbelt, Paul Walmsley, Orson Zhai, Baolin Wang,
Chunyan Zhang, Maxime Ripard, Chen-Yu Tsai, linux-pwm,
linux-rpi-kernel, linux-arm-kernel, linux-kernel, linux-rockchip,
linux-riscv
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/pwm/pwm-rockchip.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
index eb8c9cb645a6..4773969346e0 100644
--- a/drivers/pwm/pwm-rockchip.c
+++ b/drivers/pwm/pwm-rockchip.c
@@ -306,13 +306,9 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
pc->clk = devm_clk_get(&pdev->dev, "pwm");
if (IS_ERR(pc->clk)) {
pc->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(pc->clk)) {
- ret = PTR_ERR(pc->clk);
- if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev, "Can't get bus clk: %d\n",
- ret);
- return ret;
- }
+ if (IS_ERR(pc->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk),
+ "Can't get bus clk\n");
}
count = of_count_phandle_with_args(pdev->dev.of_node,
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 3/6] pwm: rockchip: Simplify with dev_err_probe()
2020-08-26 14:47 ` [PATCH 3/6] pwm: rockchip: " Krzysztof Kozlowski
@ 2020-09-02 7:13 ` Uwe Kleine-König
0 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2020-09-02 7:13 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Heiko Stuebner, Paul Cercueil, Thierry Reding, linux-riscv,
Lee Jones, Florian Fainelli, Chunyan Zhang, linux-rockchip,
Chen-Yu Tsai, bcm-kernel-feedback-list, Orson Zhai, linux-pwm,
Ray Jui, Maxime Ripard, linux-rpi-kernel, Paul Walmsley,
linux-arm-kernel, Scott Branden, linux-kernel, Palmer Dabbelt,
Baolin Wang, Nicolas Saenz Julienne
[-- Attachment #1.1: Type: text/plain, Size: 502 bytes --]
On Wed, Aug 26, 2020 at 04:47:44PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 4/6] pwm: sifive: Simplify with dev_err_probe()
2020-08-26 14:47 [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-08-26 14:47 ` [PATCH 2/6] pwm: jz4740: " Krzysztof Kozlowski
2020-08-26 14:47 ` [PATCH 3/6] pwm: rockchip: " Krzysztof Kozlowski
@ 2020-08-26 14:47 ` Krzysztof Kozlowski
2020-08-26 16:22 ` Palmer Dabbelt
2020-09-02 7:13 ` Uwe Kleine-König
2020-08-26 14:47 ` [PATCH 5/6] pwm: sprd: " Krzysztof Kozlowski
` (4 subsequent siblings)
7 siblings, 2 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-26 14:47 UTC (permalink / raw)
To: Thierry Reding, Uwe Kleine-König, Lee Jones,
Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
bcm-kernel-feedback-list, Paul Cercueil, Heiko Stuebner,
Palmer Dabbelt, Paul Walmsley, Orson Zhai, Baolin Wang,
Chunyan Zhang, Maxime Ripard, Chen-Yu Tsai, linux-pwm,
linux-rpi-kernel, linux-arm-kernel, linux-kernel, linux-rockchip,
linux-riscv
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/pwm/pwm-sifive.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/pwm/pwm-sifive.c b/drivers/pwm/pwm-sifive.c
index 62de0bb85921..2485fbaaead2 100644
--- a/drivers/pwm/pwm-sifive.c
+++ b/drivers/pwm/pwm-sifive.c
@@ -254,11 +254,9 @@ static int pwm_sifive_probe(struct platform_device *pdev)
return PTR_ERR(ddata->regs);
ddata->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(ddata->clk)) {
- if (PTR_ERR(ddata->clk) != -EPROBE_DEFER)
- dev_err(dev, "Unable to find controller clock\n");
- return PTR_ERR(ddata->clk);
- }
+ if (IS_ERR(ddata->clk))
+ return dev_err_probe(dev, PTR_ERR(ddata->clk),
+ "Unable to find controller clock\n");
ret = clk_prepare_enable(ddata->clk);
if (ret) {
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 4/6] pwm: sifive: Simplify with dev_err_probe()
2020-08-26 14:47 ` [PATCH 4/6] pwm: sifive: " Krzysztof Kozlowski
@ 2020-08-26 16:22 ` Palmer Dabbelt
2020-09-02 7:13 ` Uwe Kleine-König
1 sibling, 0 replies; 16+ messages in thread
From: Palmer Dabbelt @ 2020-08-26 16:22 UTC (permalink / raw)
To: krzk
Cc: heiko, paul, thierry.reding, linux-riscv, lee.jones, f.fainelli,
zhang.lyra, krzk, linux-rockchip, wens, bcm-kernel-feedback-list,
u.kleine-koenig, orsonzhai, linux-pwm, rjui, mripard,
linux-rpi-kernel, Paul Walmsley, linux-arm-kernel, sbranden,
linux-kernel, baolin.wang7, nsaenzjulienne
On Wed, 26 Aug 2020 07:47:45 PDT (-0700), krzk@kernel.org wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
> drivers/pwm/pwm-sifive.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pwm/pwm-sifive.c b/drivers/pwm/pwm-sifive.c
> index 62de0bb85921..2485fbaaead2 100644
> --- a/drivers/pwm/pwm-sifive.c
> +++ b/drivers/pwm/pwm-sifive.c
> @@ -254,11 +254,9 @@ static int pwm_sifive_probe(struct platform_device *pdev)
> return PTR_ERR(ddata->regs);
>
> ddata->clk = devm_clk_get(dev, NULL);
> - if (IS_ERR(ddata->clk)) {
> - if (PTR_ERR(ddata->clk) != -EPROBE_DEFER)
> - dev_err(dev, "Unable to find controller clock\n");
> - return PTR_ERR(ddata->clk);
> - }
> + if (IS_ERR(ddata->clk))
> + return dev_err_probe(dev, PTR_ERR(ddata->clk),
> + "Unable to find controller clock\n");
>
> ret = clk_prepare_enable(ddata->clk);
> if (ret) {
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/6] pwm: sifive: Simplify with dev_err_probe()
2020-08-26 14:47 ` [PATCH 4/6] pwm: sifive: " Krzysztof Kozlowski
2020-08-26 16:22 ` Palmer Dabbelt
@ 2020-09-02 7:13 ` Uwe Kleine-König
1 sibling, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2020-09-02 7:13 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Heiko Stuebner, Paul Cercueil, Thierry Reding, linux-riscv,
Lee Jones, Florian Fainelli, Chunyan Zhang, linux-rockchip,
Chen-Yu Tsai, bcm-kernel-feedback-list, Orson Zhai, linux-pwm,
Ray Jui, Maxime Ripard, linux-rpi-kernel, Paul Walmsley,
linux-arm-kernel, Scott Branden, linux-kernel, Palmer Dabbelt,
Baolin Wang, Nicolas Saenz Julienne
[-- Attachment #1.1: Type: text/plain, Size: 500 bytes --]
On Wed, Aug 26, 2020 at 04:47:45PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 5/6] pwm: sprd: Simplify with dev_err_probe()
2020-08-26 14:47 [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
` (2 preceding siblings ...)
2020-08-26 14:47 ` [PATCH 4/6] pwm: sifive: " Krzysztof Kozlowski
@ 2020-08-26 14:47 ` Krzysztof Kozlowski
2020-08-27 2:01 ` Chunyan Zhang
2020-09-02 7:14 ` Uwe Kleine-König
2020-08-26 14:47 ` [PATCH 6/6] pwm: sun4i: " Krzysztof Kozlowski
` (3 subsequent siblings)
7 siblings, 2 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-26 14:47 UTC (permalink / raw)
To: Thierry Reding, Uwe Kleine-König, Lee Jones,
Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
bcm-kernel-feedback-list, Paul Cercueil, Heiko Stuebner,
Palmer Dabbelt, Paul Walmsley, Orson Zhai, Baolin Wang,
Chunyan Zhang, Maxime Ripard, Chen-Yu Tsai, linux-pwm,
linux-rpi-kernel, linux-arm-kernel, linux-kernel, linux-rockchip,
linux-riscv
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/pwm/pwm-sprd.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c
index be2394227423..5123d948efd6 100644
--- a/drivers/pwm/pwm-sprd.c
+++ b/drivers/pwm/pwm-sprd.c
@@ -228,11 +228,8 @@ static int sprd_pwm_clk_init(struct sprd_pwm_chip *spc)
if (ret == -ENOENT)
break;
- if (ret != -EPROBE_DEFER)
- dev_err(spc->dev,
- "failed to get channel clocks\n");
-
- return ret;
+ return dev_err_probe(spc->dev, ret,
+ "failed to get channel clocks\n");
}
clk_pwm = chn->clks[SPRD_PWM_CHN_OUTPUT_CLK].clk;
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 5/6] pwm: sprd: Simplify with dev_err_probe()
2020-08-26 14:47 ` [PATCH 5/6] pwm: sprd: " Krzysztof Kozlowski
@ 2020-08-27 2:01 ` Chunyan Zhang
2020-09-02 7:14 ` Uwe Kleine-König
1 sibling, 0 replies; 16+ messages in thread
From: Chunyan Zhang @ 2020-08-27 2:01 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Heiko Stuebner, Paul Cercueil, Thierry Reding, linux-riscv,
Lee Jones, Florian Fainelli, linux-rockchip, Chen-Yu Tsai,
bcm-kernel-feedback-list, Uwe Kleine-König, Orson Zhai,
linux-pwm, Ray Jui, Maxime Ripard, linux-rpi-kernel,
Paul Walmsley, Linux ARM, Scott Branden,
Linux Kernel Mailing List, Palmer Dabbelt, Baolin Wang,
Nicolas Saenz Julienne
On Wed, 26 Aug 2020 at 22:48, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
Thanks!
> ---
> drivers/pwm/pwm-sprd.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c
> index be2394227423..5123d948efd6 100644
> --- a/drivers/pwm/pwm-sprd.c
> +++ b/drivers/pwm/pwm-sprd.c
> @@ -228,11 +228,8 @@ static int sprd_pwm_clk_init(struct sprd_pwm_chip *spc)
> if (ret == -ENOENT)
> break;
>
> - if (ret != -EPROBE_DEFER)
> - dev_err(spc->dev,
> - "failed to get channel clocks\n");
> -
> - return ret;
> + return dev_err_probe(spc->dev, ret,
> + "failed to get channel clocks\n");
> }
>
> clk_pwm = chn->clks[SPRD_PWM_CHN_OUTPUT_CLK].clk;
> --
> 2.17.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 5/6] pwm: sprd: Simplify with dev_err_probe()
2020-08-26 14:47 ` [PATCH 5/6] pwm: sprd: " Krzysztof Kozlowski
2020-08-27 2:01 ` Chunyan Zhang
@ 2020-09-02 7:14 ` Uwe Kleine-König
1 sibling, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2020-09-02 7:14 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Heiko Stuebner, Paul Cercueil, Thierry Reding, linux-riscv,
Lee Jones, Florian Fainelli, Chunyan Zhang, linux-rockchip,
Chen-Yu Tsai, bcm-kernel-feedback-list, Orson Zhai, linux-pwm,
Ray Jui, Maxime Ripard, linux-rpi-kernel, Paul Walmsley,
linux-arm-kernel, Scott Branden, linux-kernel, Palmer Dabbelt,
Baolin Wang, Nicolas Saenz Julienne
[-- Attachment #1.1: Type: text/plain, Size: 512 bytes --]
Hello,
On Wed, Aug 26, 2020 at 04:47:46PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 6/6] pwm: sun4i: Simplify with dev_err_probe()
2020-08-26 14:47 [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
` (3 preceding siblings ...)
2020-08-26 14:47 ` [PATCH 5/6] pwm: sprd: " Krzysztof Kozlowski
@ 2020-08-26 14:47 ` Krzysztof Kozlowski
2020-09-02 7:15 ` Uwe Kleine-König
2020-08-26 17:21 ` [PATCH 1/6] pwm: bcm2835: " Florian Fainelli
` (2 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-26 14:47 UTC (permalink / raw)
To: Thierry Reding, Uwe Kleine-König, Lee Jones,
Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
bcm-kernel-feedback-list, Paul Cercueil, Heiko Stuebner,
Palmer Dabbelt, Paul Walmsley, Orson Zhai, Baolin Wang,
Chunyan Zhang, Maxime Ripard, Chen-Yu Tsai, linux-pwm,
linux-rpi-kernel, linux-arm-kernel, linux-kernel, linux-rockchip,
linux-riscv
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/pwm/pwm-sun4i.c | 36 ++++++++++++------------------------
1 file changed, 12 insertions(+), 24 deletions(-)
diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c
index 961c59c99bb3..38a4c5c1317b 100644
--- a/drivers/pwm/pwm-sun4i.c
+++ b/drivers/pwm/pwm-sun4i.c
@@ -423,38 +423,26 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
* back to the first clock of the PWM.
*/
pwm->clk = devm_clk_get_optional(&pdev->dev, "mod");
- if (IS_ERR(pwm->clk)) {
- if (PTR_ERR(pwm->clk) != -EPROBE_DEFER)
- dev_err(&pdev->dev, "get mod clock failed %pe\n",
- pwm->clk);
- return PTR_ERR(pwm->clk);
- }
+ if (IS_ERR(pwm->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(pwm->clk),
+ "get mod clock failed\n");
if (!pwm->clk) {
pwm->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(pwm->clk)) {
- if (PTR_ERR(pwm->clk) != -EPROBE_DEFER)
- dev_err(&pdev->dev, "get unnamed clock failed %pe\n",
- pwm->clk);
- return PTR_ERR(pwm->clk);
- }
+ if (IS_ERR(pwm->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(pwm->clk),
+ "get unnamed clock failed\n");
}
pwm->bus_clk = devm_clk_get_optional(&pdev->dev, "bus");
- if (IS_ERR(pwm->bus_clk)) {
- if (PTR_ERR(pwm->bus_clk) != -EPROBE_DEFER)
- dev_err(&pdev->dev, "get bus clock failed %pe\n",
- pwm->bus_clk);
- return PTR_ERR(pwm->bus_clk);
- }
+ if (IS_ERR(pwm->bus_clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(pwm->bus_clk),
+ "get bus clock failed\n");
pwm->rst = devm_reset_control_get_optional_shared(&pdev->dev, NULL);
- if (IS_ERR(pwm->rst)) {
- if (PTR_ERR(pwm->rst) != -EPROBE_DEFER)
- dev_err(&pdev->dev, "get reset failed %pe\n",
- pwm->rst);
- return PTR_ERR(pwm->rst);
- }
+ if (IS_ERR(pwm->rst))
+ return dev_err_probe(&pdev->dev, PTR_ERR(pwm->rst),
+ "get reset failed\n");
/* Deassert reset */
ret = reset_control_deassert(pwm->rst);
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 6/6] pwm: sun4i: Simplify with dev_err_probe()
2020-08-26 14:47 ` [PATCH 6/6] pwm: sun4i: " Krzysztof Kozlowski
@ 2020-09-02 7:15 ` Uwe Kleine-König
0 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2020-09-02 7:15 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Heiko Stuebner, Paul Cercueil, Thierry Reding, linux-riscv,
Lee Jones, Florian Fainelli, Chunyan Zhang, linux-rockchip,
Chen-Yu Tsai, bcm-kernel-feedback-list, Orson Zhai, linux-pwm,
Ray Jui, Maxime Ripard, linux-rpi-kernel, Paul Walmsley,
linux-arm-kernel, Scott Branden, linux-kernel, Palmer Dabbelt,
Baolin Wang, Nicolas Saenz Julienne
[-- Attachment #1.1: Type: text/plain, Size: 502 bytes --]
On Wed, Aug 26, 2020 at 04:47:47PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe()
2020-08-26 14:47 [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
` (4 preceding siblings ...)
2020-08-26 14:47 ` [PATCH 6/6] pwm: sun4i: " Krzysztof Kozlowski
@ 2020-08-26 17:21 ` Florian Fainelli
2020-09-02 7:12 ` Uwe Kleine-König
2020-09-23 11:59 ` Thierry Reding
7 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2020-08-26 17:21 UTC (permalink / raw)
To: Krzysztof Kozlowski, Thierry Reding, Uwe Kleine-König,
Lee Jones, Nicolas Saenz Julienne, Florian Fainelli, Ray Jui,
Scott Branden, bcm-kernel-feedback-list, Paul Cercueil,
Heiko Stuebner, Palmer Dabbelt, Paul Walmsley, Orson Zhai,
Baolin Wang, Chunyan Zhang, Maxime Ripard, Chen-Yu Tsai,
linux-pwm, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-rockchip, linux-riscv
On 8/26/20 7:47 AM, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe()
2020-08-26 14:47 [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
` (5 preceding siblings ...)
2020-08-26 17:21 ` [PATCH 1/6] pwm: bcm2835: " Florian Fainelli
@ 2020-09-02 7:12 ` Uwe Kleine-König
2020-09-23 11:59 ` Thierry Reding
7 siblings, 0 replies; 16+ messages in thread
From: Uwe Kleine-König @ 2020-09-02 7:12 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Heiko Stuebner, Paul Cercueil, Thierry Reding, linux-riscv,
Lee Jones, Florian Fainelli, Chunyan Zhang, linux-rockchip,
Chen-Yu Tsai, bcm-kernel-feedback-list, Orson Zhai, linux-pwm,
Ray Jui, Maxime Ripard, linux-rpi-kernel, Paul Walmsley,
linux-arm-kernel, Scott Branden, linux-kernel, Palmer Dabbelt,
Baolin Wang, Nicolas Saenz Julienne
[-- Attachment #1.1: Type: text/plain, Size: 343 bytes --]
On Wed, Aug 26, 2020 at 04:47:42PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe()
2020-08-26 14:47 [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
` (6 preceding siblings ...)
2020-09-02 7:12 ` Uwe Kleine-König
@ 2020-09-23 11:59 ` Thierry Reding
7 siblings, 0 replies; 16+ messages in thread
From: Thierry Reding @ 2020-09-23 11:59 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Heiko Stuebner, Paul Cercueil, linux-riscv, Lee Jones,
Florian Fainelli, Chunyan Zhang, linux-rockchip, Chen-Yu Tsai,
bcm-kernel-feedback-list, Uwe Kleine-König, Orson Zhai,
linux-pwm, Ray Jui, Maxime Ripard, linux-rpi-kernel,
Paul Walmsley, linux-arm-kernel, Scott Branden, linux-kernel,
Palmer Dabbelt, Baolin Wang, Nicolas Saenz Julienne
[-- Attachment #1.1: Type: text/plain, Size: 401 bytes --]
On Wed, Aug 26, 2020 at 04:47:42PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
> drivers/pwm/pwm-bcm2835.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
Applied, thanks.
Thierry
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread