From patchwork Fri Mar 22 04:42:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Wang X-Patchwork-Id: 229882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::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 DD7662C00BC for ; Fri, 22 Mar 2013 15:44:05 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UItoc-0007xq-Q0; Fri, 22 Mar 2013 04:42:54 +0000 Received: from mail-vb0-x22b.google.com ([2607:f8b0:400c:c02::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UItoa-0007xX-K4 for linux-mtd@lists.infradead.org; Fri, 22 Mar 2013 04:42:53 +0000 Received: by mail-vb0-f43.google.com with SMTP id fs19so2384645vbb.16 for ; Thu, 21 Mar 2013 21:42:51 -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=+mGYRPSpQIKXXSPdI2SYWcsYcHWCrbMU8pJkUv7IONM=; b=gJILsaebafe/cieGWjWkDv3LWxL76XfRwxfyHMQ5GdYEVGGfwfPDzJ8bOAougrI2eD XnY7/v+EVyigJ73MvlXBOUTU5AcKbWQzLLwyLQHjJK5Q9fSdfeQ7SRGPMYHcC3WhKSFI Q2m84OuGXs8eYmnnuiOF1xx8ilRZHub6mgWiQin5JhZKUN7SYdXD/lm7q18mtfIQu+wP ND2VjqbeFd3ylkaT9dYTvVEQRuRjy3KoA3IcLfztipbSVo7paJ9EVnbeUXuA8gOGf/KU UMx4CH9PolCquL5SnMbbjv0B9fso341CdJxx+ptr8jdvfSWXmpSJvIpwsdWATyjSXgLS 6bHQ== X-Received: by 10.58.229.69 with SMTP id so5mr499122vec.6.1363927371106; Thu, 21 Mar 2013 21:42:51 -0700 (PDT) Received: from hchen.csail.mit.edu (hchen.csail.mit.edu. [18.26.5.5]) by mx.google.com with ESMTPS id tf2sm1295196veb.8.2013.03.21.21.42.49 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 21:42:50 -0700 (PDT) From: Xi Wang To: Artem Bityutskiy Subject: [PATCH] mtd: denali: fix error handling for devm_ioremap_nocache() Date: Fri, 22 Mar 2013 00:42:34 -0400 Message-Id: <1363927354-13125-1-git-send-email-xi.wang@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130322_004252_749477_B2FEB178 X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 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: linux-mtd@lists.infradead.org, Xi Wang 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 Use `ptr' rather than `res' to check the return value. 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;