mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] nand: mrvl: use ERR_CAST() for returning error pointers
Date: Mon, 25 Jul 2016 10:27:04 +0200	[thread overview]
Message-ID: <1469435224-20676-1-git-send-email-s.hauer@pengutronix.de> (raw)

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>
---
 drivers/mtd/nand/nand_mrvl_nfc.c | 6 +++---
 1 file 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);
 
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2016-07-25  8:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469435224-20676-1-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox