linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Anup Limbu <anuplimbu14@gmail.com>
To: dwmw2@infradead.org, computersforpeace@gmail.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Anup Limbu <anuplimbu14@gmail.com>
Subject: [PATCH] mtd: nand: davinci: remove unnecessary if cases
Date: Fri, 27 Nov 2015 13:35:34 +0530	[thread overview]
Message-ID: <1448611534-21142-1-git-send-email-anuplimbu14@gmail.com> (raw)

remove unnecessary if cases

Signed-off-by: Anup Limbu <anuplimbu14@gmail.com>
---
 drivers/mtd/nand/davinci_nand.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index c72313d..1f86ee1 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -568,21 +568,16 @@ static struct davinci_nand_pdata
 		pdev->dev.platform_data = pdata;
 		if (!pdata)
 			return ERR_PTR(-ENOMEM);
-		if (!of_property_read_u32(pdev->dev.of_node,
-			"ti,davinci-chipselect", &prop))
-			pdev->id = prop;
-		else
+		if (of_property_read_u32(pdev->dev.of_node,
+			"ti,davinci-chipselect", &pdev->id))
 			return ERR_PTR(-EINVAL);
 
-		if (!of_property_read_u32(pdev->dev.of_node,
-			"ti,davinci-mask-ale", &prop))
-			pdata->mask_ale = prop;
-		if (!of_property_read_u32(pdev->dev.of_node,
-			"ti,davinci-mask-cle", &prop))
-			pdata->mask_cle = prop;
-		if (!of_property_read_u32(pdev->dev.of_node,
-			"ti,davinci-mask-chipsel", &prop))
-			pdata->mask_chipsel = prop;
+		of_property_read_u32(pdev->dev.of_node,
+			"ti,davinci-mask-ale", &pdata->mask_ale);
+		of_property_read_u32(pdev->dev.of_node,
+			"ti,davinci-mask-cle", &pdata->mask_cle);
+		of_property_read_u32(pdev->dev.of_node,
+			"ti,davinci-mask-chipsel", &pdata->mask_chipsel);
 		if (!of_property_read_string(pdev->dev.of_node,
 			"nand-ecc-mode", &mode) ||
 		    !of_property_read_string(pdev->dev.of_node,
@@ -594,9 +589,8 @@ static struct davinci_nand_pdata
 			if (!strncmp("hw", mode, 2))
 				pdata->ecc_mode = NAND_ECC_HW;
 		}
-		if (!of_property_read_u32(pdev->dev.of_node,
-			"ti,davinci-ecc-bits", &prop))
-			pdata->ecc_bits = prop;
+		of_property_read_u32(pdev->dev.of_node,
+			"ti,davinci-ecc-bits", &pdata->ecc_bits);
 
 		prop = of_get_nand_bus_width(pdev->dev.of_node);
 		if (0 < prop || !of_property_read_u32(pdev->dev.of_node,
-- 
1.9.1

             reply	other threads:[~2015-11-27  8:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27  8:05 Anup Limbu [this message]
2015-12-01  0:40 ` [PATCH] mtd: nand: davinci: remove unnecessary if cases Brian Norris

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=1448611534-21142-1-git-send-email-anuplimbu14@gmail.com \
    --to=anuplimbu14@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@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;
as well as URLs for NNTP newsgroup(s).