aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/atmel/nand-controller.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <[email protected]>2020-09-01 14:25:31 +0000
committerMiquel Raynal <[email protected]>2020-09-30 14:44:16 +0000
commit1caa7522fad54d8439dae8515d0a89f3fabc65a7 (patch)
treeed41eaf43162eb688bfd5876b67101d7f3cfc8dd /drivers/mtd/nand/raw/atmel/nand-controller.c
parentmtd: onenand: Simplify with dev_err_probe() (diff)
downloadkernel-1caa7522fad54d8439dae8515d0a89f3fabc65a7.tar.gz
kernel-1caa7522fad54d8439dae8515d0a89f3fabc65a7.zip
mtd: rawnand: atmel: 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 <[email protected]> Reviewed-by: Alexandre Belloni <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
Diffstat (limited to 'drivers/mtd/nand/raw/atmel/nand-controller.c')
-rw-r--r--drivers/mtd/nand/raw/atmel/nand-controller.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index 8916a97cafa9..309ce410d792 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -2027,13 +2027,9 @@ static int atmel_nand_controller_init(struct atmel_nand_controller *nc,
platform_set_drvdata(pdev, nc);
nc->pmecc = devm_atmel_pmecc_get(dev);
- if (IS_ERR(nc->pmecc)) {
- ret = PTR_ERR(nc->pmecc);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "Could not get PMECC object (err = %d)\n",
- ret);
- return ret;
- }
+ if (IS_ERR(nc->pmecc))
+ return dev_err_probe(dev, PTR_ERR(nc->pmecc),
+ "Could not get PMECC object\n");
if (nc->caps->has_dma && !atmel_nand_avoid_dma) {
dma_cap_mask_t mask;