mtd: nand: omap: fix error return code in omap_nand_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 1 Nov 2013 00:16:18 +0000 (08:16 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 7 Nov 2013 07:33:15 +0000 (23:33 -0800)
Fix to return a negative error code from the error handling case instead
of 0, to more closely match the rest of this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/omap2.c

index ec40b8d10201d7429b8e8c9f9f6de8f3441f9aee..f77725009907751e62963f02a6ce52b10e41e366 100644 (file)
@@ -1953,7 +1953,8 @@ static int omap_nand_probe(struct platform_device *pdev)
                nand_chip->ecc.read_page        = omap_read_page_bch;
                nand_chip->ecc.write_page       = omap_write_page_bch;
                /* This ECC scheme requires ELM H/W block */
-               if (is_elm_present(info, pdata->elm_of_node, BCH8_ECC) < 0) {
+               err = is_elm_present(info, pdata->elm_of_node, BCH8_ECC);
+               if (err < 0) {
                        pr_err("nand: error: could not initialize ELM\n");
                        goto return_error;
                }