linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: linux-mtd@lists.infradead.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Brian Norris <computersforpeace@gmail.com>
Subject: [PATCH 2/3] mtd: nand: fsmc: Remove BUG macros
Date: Fri,  2 Oct 2015 12:40:21 +0200	[thread overview]
Message-ID: <1443782422-4515-2-git-send-email-sr@denx.de> (raw)
In-Reply-To: <1443782422-4515-1-git-send-email-sr@denx.de>

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>
Cc: Brian Norris <computersforpeace@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;
 		}
 	}
 
-- 
2.5.3

  reply	other threads:[~2015-10-02 10:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02 10:40 [PATCH 1/3] mtd: nand: fsmc: Small whitespace cleanup Stefan Roese
2015-10-02 10:40 ` Stefan Roese [this message]
2015-10-05  7:42   ` [PATCH 2/3] mtd: nand: fsmc: Remove BUG macros Linus Walleij
2015-10-02 10:40 ` [PATCH 3/3 v2] mtd: nand: fsmc: Add BCH4 SW ECC support for SPEAr600 Stefan Roese
2015-10-02 18:04   ` Brian Norris
2015-10-19  6:40   ` [PATCH 3/3 v3] " Stefan Roese
2015-10-26 20:20     ` Brian Norris
2015-10-27  5:49       ` Stefan Roese
2015-10-02 18:09 ` [PATCH 1/3] mtd: nand: fsmc: Small whitespace cleanup Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443782422-4515-2-git-send-email-sr@denx.de \
    --to=sr@denx.de \
    --cc=computersforpeace@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).