mtd: nand: fsmc: Remove BUG macros
authorStefan Roese <sr@denx.de>
Fri, 2 Oct 2015 10:40:21 +0000 (12:40 +0200)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 2 Oct 2015 18:08:17 +0000 (11:08 -0700)
Remove the BUG macros and return with error (if possible) instead.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/fsmc_nand.c

index dc94882616905ab1f922817c030fc0591d3f8205..45948e8f5fb03b5cbf9ca7bc056a3079a4f58787 100644 (file)
@@ -348,7 +348,7 @@ static void fsmc_select_chip(struct mtd_info *mtd, int chipnr)
                break;
 
        default:
-               BUG();
+               dev_err(host->dev, "unsupported chip-select %d\n", chipnr);
        }
 }
 
@@ -1111,7 +1111,8 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
                default:
                        dev_warn(&pdev->dev, "No oob scheme defined for oobsize %d\n",
                                 mtd->oobsize);
-                       BUG();
+                       ret = -EINVAL;
+                       goto err_probe;
                }
        } else {
                switch (host->mtd.oobsize) {
@@ -1127,7 +1128,8 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
                default:
                        dev_warn(&pdev->dev, "No oob scheme defined for oobsize %d\n",
                                 mtd->oobsize);
-                       BUG();
+                       ret = -EINVAL;
+                       goto err_probe;
                }
        }