mtd: nand: fsmc: Remove BUG macros

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 6 10:59:09 PST 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=6efadcf9592c2ed438d1692ca55168e3de5c975b
Commit:     6efadcf9592c2ed438d1692ca55168e3de5c975b
Parent:     cbf29b83caa8c336cdb80b44bd1b959372e24d28
Author:     Stefan Roese <sr at denx.de>
AuthorDate: Fri Oct 2 12:40:21 2015 +0200
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Oct 2 11:08:17 2015 -0700

    mtd: nand: fsmc: Remove BUG macros
    
    Remove the BUG macros and return with error (if possible) instead.
    
    Signed-off-by: Stefan Roese <sr at denx.de>
    Cc: Linus Walleij <linus.walleij at linaro.org>
    Cc: Viresh Kumar <viresh.kumar at linaro.org>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/fsmc_nand.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index dc94882..45948e8 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;
 		}
 	}
 



More information about the linux-mtd-cvs mailing list