[PATCH 3/3] nand: mrvl: don't double cast error pointer
Sascha Hauer
s.hauer at pengutronix.de
Mon Jul 25 01:20:59 PDT 2016
On Fri, Jul 22, 2016 at 03:00:21PM +0200, Lucas Stach wrote:
> Fixes:
> In function 'alloc_nand_resource':
> warning: return makes pointer from integer without a cast
>
> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> ---
> drivers/mtd/nand/nand_mrvl_nfc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/nand_mrvl_nfc.c b/drivers/mtd/nand/nand_mrvl_nfc.c
> index 578790da2612..1341f084d8f8 100644
> --- a/drivers/mtd/nand/nand_mrvl_nfc.c
> +++ b/drivers/mtd/nand/nand_mrvl_nfc.c
> @@ -1138,7 +1138,7 @@ 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 iores;
Better use ERR_CAST() here. It makes it more explicit that an error is
returned here.
Sascha
> host->mmio_base = IOMEM(iores->start);
> if (IS_ERR(host->mmio_base)) {
> free(host);
> --
> 2.8.1
>
>
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list