linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] mtd: onenand: Simplify with dev_err_probe()
@ 2020-09-01 14:25 Krzysztof Kozlowski
  2020-09-01 14:25 ` [PATCH 2/6] mtd: rawnand: atmel: " Krzysztof Kozlowski
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 14:25 UTC (permalink / raw)
  To: Kyungmin Park, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Tudor Ambarus, Nicolas Ferre,
	Alexandre Belloni, Ludovic Desroches, Han Xu, linux-mtd,
	linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mtd/nand/onenand/onenand_omap2.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/onenand/onenand_omap2.c b/drivers/mtd/nand/onenand/onenand_omap2.c
index aa9368bf7a0c..d8c0bd002c2b 100644
--- a/drivers/mtd/nand/onenand/onenand_omap2.c
+++ b/drivers/mtd/nand/onenand/onenand_omap2.c
@@ -494,11 +494,8 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 
 	c->int_gpiod = devm_gpiod_get_optional(dev, "int", GPIOD_IN);
 	if (IS_ERR(c->int_gpiod)) {
-		r = PTR_ERR(c->int_gpiod);
 		/* Just try again if this happens */
-		if (r != -EPROBE_DEFER)
-			dev_err(dev, "error getting gpio: %d\n", r);
-		return r;
+		return dev_err_probe(dev, PTR_ERR(c->int_gpiod), "error getting gpio\n");
 	}
 
 	if (c->int_gpiod) {
-- 
2.17.1


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

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

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 14:25 [PATCH 1/6] mtd: onenand: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-01 14:25 ` [PATCH 2/6] mtd: rawnand: atmel: " Krzysztof Kozlowski
2020-09-01 19:12   ` Alexandre Belloni
2020-09-11 16:56   ` Miquel Raynal
2020-09-01 14:25 ` [PATCH 3/6] mtd: rawnand: gpmi: " Krzysztof Kozlowski
2020-09-11 16:55   ` Miquel Raynal
2020-09-01 14:25 ` [PATCH 4/6] mtd: rawnand: marvell: " Krzysztof Kozlowski
2020-09-11 16:55   ` Miquel Raynal
2020-09-01 14:25 ` [PATCH 5/6] mtd: rawnand: marvell: Fix and update kerneldoc Krzysztof Kozlowski
2020-09-11 16:55   ` Miquel Raynal
2020-09-01 14:25 ` [PATCH 6/6] mtd: rawnand: qcom: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-11 16:55   ` Miquel Raynal
2020-09-11 16:56 ` [PATCH 1/6] mtd: onenand: " Miquel Raynal

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