From patchwork Wed Nov 19 13:16:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5337371 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A0F679F2ED for ; Wed, 19 Nov 2014 13:32:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35832201CD for ; Wed, 19 Nov 2014 13:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 605842010E for ; Wed, 19 Nov 2014 13:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754233AbaKSNcl (ORCPT ); Wed, 19 Nov 2014 08:32:41 -0500 Received: from mail-bn1on0113.outbound.protection.outlook.com ([157.56.110.113]:5308 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753408AbaKSNck (ORCPT ); Wed, 19 Nov 2014 08:32:40 -0500 X-Greylist: delayed 928 seconds by postgrey-1.27 at vger.kernel.org; Wed, 19 Nov 2014 08:32:40 EST Received: from BN3PR0301CA0075.namprd03.prod.outlook.com (25.160.152.171) by BL2PR03MB243.namprd03.prod.outlook.com (10.255.231.23) with Microsoft SMTP Server (TLS) id 15.1.26.15; Wed, 19 Nov 2014 13:17:10 +0000 Received: from BN1AFFO11FD037.protection.gbl (2a01:111:f400:7c10::187) by BN3PR0301CA0075.outlook.office365.com (2a01:111:e400:401e::43) with Microsoft SMTP Server (TLS) id 15.1.16.15 via Frontend Transport; Wed, 19 Nov 2014 13:17:09 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD037.mail.protection.outlook.com (10.58.52.241) with Microsoft SMTP Server (TLS) id 15.1.6.13 via Frontend Transport; Wed, 19 Nov 2014 13:17:09 +0000 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.244.75]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id sAJDH6Si006141; Wed, 19 Nov 2014 06:17:07 -0700 From: Fabio Estevam To: CC: , , Fabio Estevam Subject: [PATCH 1/3] mmc: mxs-mmc: No need to do NULL check on 'iores' Date: Wed, 19 Nov 2014 11:16:57 -0200 Message-ID: <1416403019-6353-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Fabio.Estevam@freescale.com; X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(68736004)(19580405001)(6806004)(19580395003)(97736003)(89996001)(84676001)(85426001)(106466001)(21056001)(44976005)(87936001)(95666004)(87286001)(107046002)(93916002)(86362001)(229853001)(64706001)(2351001)(20776003)(47776003)(62966003)(88136002)(92566001)(77156002)(92726001)(36756003)(33646002)(110136001)(104016003)(31966008)(102836001)(50226001)(46102003)(48376002)(50466002)(4396001)(50986999)(120916001)(99396003)(105606002)(104166001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB243; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB243; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB243; X-Forefront-PRVS: 04004D94E2 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB243; X-OriginatorOrg: freescale.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP devm_ioremap_resource() already checks if 'iores' is NULL or not, so we can skip this manual check. While at it, move platform_get_resource() closer to devm_ioremap_resource() for better readability. Signed-off-by: Fabio Estevam --- drivers/mmc/host/mxs-mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index c049ac7..0d30730 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -581,9 +581,8 @@ static int mxs_mmc_probe(struct platform_device *pdev) struct regulator *reg_vmmc; struct mxs_ssp *ssp; - iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); irq_err = platform_get_irq(pdev, 0); - if (!iores || irq_err < 0) + if (irq_err < 0) return -EINVAL; mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev); @@ -593,6 +592,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) host = mmc_priv(mmc); ssp = &host->ssp; ssp->dev = &pdev->dev; + iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); ssp->base = devm_ioremap_resource(&pdev->dev, iores); if (IS_ERR(ssp->base)) { ret = PTR_ERR(ssp->base);