summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-09-01 16:25:30 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-09-30 16:44:16 +0200
commit28acb2ce42c44acb11dd5825594d8dff99a2eb4a (patch)
tree1683a1bab6774e94fef3b648b57f5bd632b199aa /drivers/mtd
parentmtd: rawnand: marvell: Support panic_write for mtdoops (diff)
downloadlinux-28acb2ce42c44acb11dd5825594d8dff99a2eb4a.tar.xz
linux-28acb2ce42c44acb11dd5825594d8dff99a2eb4a.zip
mtd: onenand: Simplify with dev_err_probe()
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> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200901142535.12819-1-krzk@kernel.org
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/onenand/onenand_omap2.c5
1 files changed, 1 insertions, 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) {