From: Saurabh Sengar <saurabh.truth@gmail.com>
To: mans@mansr.com, dwmw2@infradead.org, computersforpeace@gmail.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Saurabh Sengar <saurabh.truth@gmail.com>
Subject: [PATCH v2] mtd: nand: use of_property_read_u8()
Date: Mon, 23 Nov 2015 21:45:29 +0530 [thread overview]
Message-ID: <1448295329-3087-1-git-send-email-saurabh.truth@gmail.com> (raw)
In-Reply-To: <201511232333.kj6JWXch%fengguang.wu@intel.com>
use of_property_read_u8() for u8 values
Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
v2 : added the missed semi colon
drivers/mtd/nand/orion_nand.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index ee83749..0cbebc5 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -83,7 +83,6 @@ static int __init orion_nand_probe(struct platform_device *pdev)
struct clk *clk;
void __iomem *io_base;
int ret = 0;
- u32 val = 0;
nc = devm_kzalloc(&pdev->dev,
sizeof(struct nand_chip) + sizeof(struct mtd_info),
@@ -103,22 +102,15 @@ static int __init orion_nand_probe(struct platform_device *pdev)
GFP_KERNEL);
if (!board)
return -ENOMEM;
- if (!of_property_read_u32(pdev->dev.of_node, "cle", &val))
- board->cle = (u8)val;
- else
- board->cle = 0;
- if (!of_property_read_u32(pdev->dev.of_node, "ale", &val))
- board->ale = (u8)val;
- else
+ of_property_read_u8(pdev->dev.of_node, "cle", &board->cle);
+
+ if (of_property_read_u8(pdev->dev.of_node, "ale", &board->ale))
board->ale = 1;
- if (!of_property_read_u32(pdev->dev.of_node,
- "bank-width", &val))
- board->width = (u8)val * 8;
- else
+ if (of_property_read_u8(pdev->dev.of_node,
+ "bank-width", &board->width))
board->width = 8;
- if (!of_property_read_u32(pdev->dev.of_node,
- "chip-delay", &val))
- board->chip_delay = (u8)val;
+ of_property_read_u8(pdev->dev.of_node,
+ "chip-delay", &board->chip_delay);
} else {
board = dev_get_platdata(&pdev->dev);
}
--
1.9.1
next prev parent reply other threads:[~2015-11-23 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 14:27 [PATCH] mtd: nand: use of_property_read_u8() Saurabh Sengar
2015-11-23 16:01 ` kbuild test robot
2015-11-23 16:15 ` Saurabh Sengar [this message]
2015-11-23 18:05 ` [PATCH v2] " Geert Uytterhoeven
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=1448295329-3087-1-git-send-email-saurabh.truth@gmail.com \
--to=saurabh.truth@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mans@mansr.com \
/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