summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-07-22 15:00:21 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-25 10:26:50 +0200
commit370e90bac98c4e1073578c16f46d5a123b8df052 (patch)
tree4bdff227281870d894e3fec545e9bfd3330127d6
parentc77af5e5cb9949bf11eee432ead5e2cf1efb8dcc (diff)
downloadbarebox-370e90bac98c4e1073578c16f46d5a123b8df052.tar.gz
nand: mrvl: use ERR_CAST() for returning error pointers
ERR_CAST exists to return error pointers as error pointers without casting them explicitly to the correct pointer type. Also this Fixes: In function 'alloc_nand_resource': warning: return makes pointer from integer without a cast Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/mtd/nand/nand_mrvl_nfc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_mrvl_nfc.c b/drivers/mtd/nand/nand_mrvl_nfc.c
index 578790d..f48403d 100644
--- a/drivers/mtd/nand/nand_mrvl_nfc.c
+++ b/drivers/mtd/nand/nand_mrvl_nfc.c
@@ -1138,16 +1138,16 @@ static struct mrvl_nand_host *alloc_nand_resource(struct device_d *dev)
host->dev = dev;
iores = dev_request_mem_resource(dev, 0);
if (IS_ERR(iores))
- return PTR_ERR(iores);
+ return ERR_CAST(iores);
host->mmio_base = IOMEM(iores->start);
if (IS_ERR(host->mmio_base)) {
free(host);
- return host->mmio_base;
+ return ERR_CAST(host->mmio_base);
}
host->core_clk = clk_get(dev, NULL);
if (IS_ERR(host->core_clk)) {
free(host);
- return (void *)host->core_clk;
+ return ERR_CAST(host->core_clk);
}
clk_enable(host->core_clk);