From patchwork Fri May 3 04:37:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Wang X-Patchwork-Id: 241146 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A36722C00C9 for ; Fri, 3 May 2013 14:39:29 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UY7m3-0008PJ-OL; Fri, 03 May 2013 04:39:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UY7m0-0007Yj-Ms; Fri, 03 May 2013 04:39:08 +0000 Received: from mail-qe0-f42.google.com ([209.85.128.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UY7lw-0007Xa-53 for linux-mtd@lists.infradead.org; Fri, 03 May 2013 04:39:06 +0000 Received: by mail-qe0-f42.google.com with SMTP id 1so722833qee.1 for ; Thu, 02 May 2013 21:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=zvF1jBg5wbdOq3TuMuqLkB7ij+3BWwO75SFrlYRlPXk=; b=f4n5kX1WvpCD/kOqJ4i2Yt8u+KTf5nwBN81XRUhoNz0s4dUTuBfA6t1DcpBEPW4w5H K8J89Et1k7QQDvfyhtKcdHWpNNP+PpW5YKRb1PhsWD8ZdslGLEYIPEUbELFAYd6fzEHK cONvj/aga4DM7bZcihGcGb5pNWZHAl6wrrSQTpCOHHCpYmlvoDmc5lJ6atlywdEGsAO9 VCRh+JHdMx3Z18ij96vaTQCpyALs/yQo/Bel8EmUTvz3bV4hfiliTkiK6PFC3Ol+iehq 1a5+VnF60z+v7vFHclIBQZ3Iyc2XW/MsskMt5K//9J7ghOoXyjZIAvdU8RP+Cgs3GVD6 UAug== X-Received: by 10.49.61.106 with SMTP id o10mr281254qer.20.1367555921139; Thu, 02 May 2013 21:38:41 -0700 (PDT) Received: from hchen.csail.mit.edu (hchen.csail.mit.edu. [18.26.5.5]) by mx.google.com with ESMTPSA id i5sm15930932qaf.0.2013.05.02.21.38.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 21:38:40 -0700 (PDT) From: Xi Wang To: linux-mtd@lists.infradead.org Subject: [PATCH RESEND] mtd: denali: fix error handling for devm_ioremap_nocache() Date: Fri, 3 May 2013 00:37:19 -0400 Message-Id: <1367555839-12920-1-git-send-email-xi.wang@gmail.com> X-Mailer: git-send-email 1.8.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130503_003904_460912_7B98308D X-CRM114-Status: GOOD ( 11.05 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.128.42 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (xi.wang[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: David Woodhouse , Xi Wang , Artem Bityutskiy X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org It is incorrect to use `!res' for error handling since `res' must be non-null. Use the return value `ptr' instead. Signed-off-by: Xi Wang --- drivers/mtd/nand/denali_dt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index 546f8cb..02988b0 100644 --- a/drivers/mtd/nand/denali_dt.c +++ b/drivers/mtd/nand/denali_dt.c @@ -42,7 +42,7 @@ static void __iomem *request_and_map(struct device *dev, } ptr = devm_ioremap_nocache(dev, res->start, resource_size(res)); - if (!res) + if (!ptr) dev_err(dev, "ioremap_nocache of %s failed!", res->name); return ptr;