From patchwork Sun Jul 21 17:52:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 260537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [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 8BF512C00CA for ; Mon, 22 Jul 2013 03:53:05 +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 1V0xoM-0005Hi-B0; Sun, 21 Jul 2013 17:52:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V0xoJ-0005HE-Jm; Sun, 21 Jul 2013 17:52:43 +0000 Received: from mail-ye0-x236.google.com ([2607:f8b0:4002:c04::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V0xoC-0005Gj-Qc for linux-mtd@lists.infradead.org; Sun, 21 Jul 2013 17:52:37 +0000 Received: by mail-ye0-f182.google.com with SMTP id m12so1888900yen.41 for ; Sun, 21 Jul 2013 10:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=n2E9Wp+AqWwZ084iR8cFZINxGYsgIm2V4gsUa6XmPbk=; b=HmR1L9lBT9qfs0K0MBPx8c7VjrhYE2G8g0Qelr9oGEmWxnljEoNndwoEQMRposGKqV I5QkQhaY+v1RsH5oDdLJI+7Ld1BAHLOjoQcs1lYSLggC+aXI7uzAwDIlR/ttZJj4heAT hjmVhxmcJ2HrvGWfx0rmgBBAI0Mqx1dGdDJdaMj7NZ2w5rjn7+HFG55ekyO9FFPFuyzf dSDFYdxrSWx5NHPwAxvn9VpJXg2gHiTbPSKwRI9Nj90rjAYtCiS6piYjW4GekCHMxkMr WlzQ6Csnop+hDQw0JqmC79KOQE49JkoFhHOEigEqoremJ61FKGurhsCqZWB45QwpXZWw Qx9A== X-Received: by 10.236.38.170 with SMTP id a30mr12030062yhb.215.1374429133102; Sun, 21 Jul 2013 10:52:13 -0700 (PDT) Received: from localhost.localdomain ([189.5.19.145]) by mx.google.com with ESMTPSA id y70sm34433918yhe.15.2013.07.21.10.52.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Jul 2013 10:52:12 -0700 (PDT) From: Fabio Estevam To: dwmw2@infradead.org Subject: [PATCH] nand: mxc_nand: Remove unneeded check for platform_get_resource() Date: Sun, 21 Jul 2013 14:52:02 -0300 Message-Id: <1374429122-15514-1-git-send-email-festevam@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-20130721_135236_951368_138CC7B0 X-CRM114-Status: UNSURE ( 8.60 ) 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 (festevam[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: Fabio Estevam , artem.bityutskiy@linux.intel.com, s.hauer@pengutronix.de, linux-mtd@lists.infradead.org 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 From: Fabio Estevam devm_ioremap_resource() checks its arguments, so there is no need for explicitly checking the return value from platform_get_resource(). Signed-off-by: Fabio Estevam --- drivers/mtd/nand/mxc_nand.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 18855ad..0581bd3 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -1446,8 +1446,6 @@ static int mxcnd_probe(struct platform_device *pdev) if (host->devtype_data->needs_ip) { res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; host->regs_ip = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(host->regs_ip)) return PTR_ERR(host->regs_ip); @@ -1457,9 +1455,6 @@ static int mxcnd_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); } - if (!res) - return -ENODEV; - host->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(host->base)) return PTR_ERR(host->base);