From: Stefan Roese Date: Fri, 2 Oct 2015 10:40:21 +0000 (+0200) Subject: mtd: nand: fsmc: Remove BUG macros X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6efadcf9592c2ed438d1692ca55168e3de5c975b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mtd: nand: fsmc: Remove BUG macros Remove the BUG macros and return with error (if possible) instead. Signed-off-by: Stefan Roese Cc: Linus Walleij Cc: Viresh Kumar Signed-off-by: Brian Norris --- diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c index dc9488261690..45948e8f5fb0 100644 --- a/drivers/mtd/nand/fsmc_nand.c +++ b/drivers/mtd/nand/fsmc_nand.c @@ -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; } }