Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755061AbbKWO1W (ORCPT ); Mon, 23 Nov 2015 09:27:22 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:36283 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318AbbKWO1V (ORCPT ); Mon, 23 Nov 2015 09:27:21 -0500 From: Saurabh Sengar To: dwmw2@infradead.org, computersforpeace@gmail.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Saurabh Sengar Subject: [PATCH] mtd: nand: use of_property_read_u8() Date: Mon, 23 Nov 2015 19:57:05 +0530 Message-Id: <1448288825-4928-1-git-send-email-saurabh.truth@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1864 Lines: 57 use of_property_read_u8() for u8 values Signed-off-by: Saurabh Sengar --- 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..1a68145 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/