mtd: rawnand: gpmi: return valid value from bch_set_geometry()
authorSascha Hauer <s.hauer@pengutronix.de>
Thu, 26 Apr 2018 15:41:26 +0000 (17:41 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Sun, 29 Apr 2018 06:56:48 +0000 (08:56 +0200)
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@pengutronix.de>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c

index 39834bedf46071dde94005804f571a6a9f93c6ed..83697b8df8717afaa45a17d1dc2e2887bdb9cc1b 100644 (file)
@@ -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;