linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] pwm: bcm2835: Simplify with dev_err_probe()
@ 2020-08-26 14:47 Krzysztof Kozlowski
  2020-08-26 14:47 ` [PATCH 2/6] pwm: jz4740: " Krzysztof Kozlowski
                   ` (7 more replies)
  0 siblings, 8 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-bcm2835.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c
index d78f86f8e462..6841dcfe27fc 100644
--- a/drivers/pwm/pwm-bcm2835.c
+++ b/drivers/pwm/pwm-bcm2835.c
@@ -152,13 +152,9 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
 		return PTR_ERR(pc->base);
 
 	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, "clock not found: %d\n", ret);
-
-		return ret;
-	}
+	if (IS_ERR(pc->clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk),
+				     "clock not found\n");
 
 	ret = clk_prepare_enable(pc->clk);
 	if (ret)
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2020-09-23 11:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-09-02  7:12   ` Uwe Kleine-König
2020-08-26 14:47 ` [PATCH 3/6] pwm: rockchip: " Krzysztof Kozlowski
2020-09-02  7:13   ` Uwe Kleine-König
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
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
2020-08-26 14:47 ` [PATCH 6/6] pwm: sun4i: " Krzysztof Kozlowski
2020-09-02  7:15   ` Uwe Kleine-König
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

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