From patchwork Fri Oct 2 10:40:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 525452 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 408031400CB for ; Fri, 2 Oct 2015 20:42:29 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zhxli-000111-OA; Fri, 02 Oct 2015 10:40:50 +0000 Received: from mo6-p05-ob.smtp.rzone.de ([2a01:238:20a:202:5305::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zhxlg-0000jh-1M for linux-mtd@lists.infradead.org; Fri, 02 Oct 2015 10:40:48 +0000 X-RZG-AUTH: :IW0NeWC7b/q2i6W/qstXb1SBUuFnrGohfvxEndrDXKjzPMsB3oimjD61I4fPQhgcxWwS7w== X-RZG-CLASS-ID: mo05 Received: from stefan-work.domain_not_set.invalid (b9168fda.cgn.dg-w.de [185.22.143.218]) by post.strato.de (RZmta 37.12 AUTH) with ESMTPA id m05a4br92AeMrrH; Fri, 2 Oct 2015 12:40:22 +0200 (CEST) From: Stefan Roese To: linux-mtd@lists.infradead.org Subject: [PATCH 2/3] mtd: nand: fsmc: Remove BUG macros Date: Fri, 2 Oct 2015 12:40:21 +0200 Message-Id: <1443782422-4515-2-git-send-email-sr@denx.de> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1443782422-4515-1-git-send-email-sr@denx.de> References: <1443782422-4515-1-git-send-email-sr@denx.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151002_034048_288793_D8E13570 X-CRM114-Status: UNSURE ( 8.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a01:238:20a:202:5305:0:0:2 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Viresh Kumar , Linus Walleij , Brian Norris MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Remove the BUG macros and return with error (if possible) instead. Signed-off-by: Stefan Roese Cc: Linus Walleij Cc: Viresh Kumar Cc: Brian Norris Reviewed-by: Linus Walleij --- 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; } }