[PATCH 05/18] mtd: nand: gpmi: return valid value from bch_set_geometry()
Sam Lefebvre
sam.lefebvre at essensium.com
Fri Apr 20 01:19:33 PDT 2018
From: Sascha Hauer <s.hauer at pengutronix.de>
The caller of bch_set_geometry() expects the return value to
be an error code, so !0 is not valid. return the error from the
just called function instead.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
---
v2: rebased
---
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
index 39834bedf460..83697b8df871 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
@@ -258,8 +258,9 @@ int bch_set_geometry(struct gpmi_nand_data *this)
unsigned int gf_len;
int ret;
- if (common_nfc_set_geometry(this))
- return !0;
+ ret = common_nfc_set_geometry(this);
+ if (ret)
+ return ret;
block_count = bch_geo->ecc_chunk_count - 1;
block_size = bch_geo->ecc_chunk_size;
--
2.14.1
More information about the linux-mtd
mailing list