From c8f0033be80ccb23230b6b572c328d1c02e4ad04 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Wed, 23 Aug 2017 17:24:46 +0200 Subject: mtd: gpmi: fsl,legacy-bch-geometry independent of nand-on-flash-bbt The device tree property fsl,legacy-bch-geometry was only evaluated when nand-on-flash-bbt was also defined. This looks wrong. In mainline (as of 4.12) fsl,legacy-bch-geometry doesn't exist, its functionality seems to be taken over by the fsl,use-minimum-ecc property and it is used independent of nand-on-flash-bbt. The move of code gets also rid of the following compiler warning: drivers/mtd/nand/gpmi-nand/gpmi-nand.c:2274:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (of_property_read_bool(this->dev->of_node, ^~ drivers/mtd/nand/gpmi-nand/gpmi-nand.c:2278:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if (of_property_read_bool(this->dev->of_node, ^~ Signed-off-by: Max Krummenacher Acked-by: Stefan Agner --- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 138f2dc3e75a..f8c803866ce5 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c @@ -2271,10 +2271,6 @@ static int gpmi_nand_init(struct gpmi_nand_data *this) if (of_get_nand_on_flash_bbt(this->dev->of_node)) { chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB; - if (of_property_read_bool(this->dev->of_node, - "fsl,legacy-bch-geometry")) - this->legacy_bch_geometry = true; - if (of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap")) this->swap_block_mark = false; @@ -2282,6 +2278,10 @@ static int gpmi_nand_init(struct gpmi_nand_data *this) dev_dbg(this->dev, "Blockmark swapping %sabled\n", this->swap_block_mark ? "en" : "dis"); + if (of_property_read_bool(this->dev->of_node, + "fsl,legacy-bch-geometry")) + this->legacy_bch_geometry = true; + /* * Allocate a temporary DMA buffer for reading ID in the * nand_scan_ident(). -- cgit v1.2.3