From patchwork Wed Apr 20 02:16:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 66161 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2195273qge; Tue, 19 Apr 2016 19:16:39 -0700 (PDT) X-Received: by 10.98.92.135 with SMTP id q129mr8594911pfb.71.1461118599655; Tue, 19 Apr 2016 19:16:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si14863250pfm.61.2016.04.19.19.16.39; Tue, 19 Apr 2016 19:16:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583AbcDTCQP (ORCPT + 29 others); Tue, 19 Apr 2016 22:16:15 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:38430 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754308AbcDTCQD (ORCPT ); Tue, 19 Apr 2016 22:16:03 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id u3K2FZ7j005192; Wed, 20 Apr 2016 11:15:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u3K2FZ7j005192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1461118541; bh=6p7xxaxInr7pHXp7J5xTy6hG+E6iolc1bxmVWBO45bU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i5Gyw5qKZkN1u1JgoZRjXtpka6y9llEcR4BH7eFJPFDpDKsVt9rHg6buxCuTk9UN1 1e/SygEgSomuUeAWGor/mWL/PAM9/+famWwRUHVWhvINSUGi3fuC23DJjgMZLs8v+x NUUDg/ZioBskYN3pwK6yKWnKpCpnmKQXYPH2lbPfMlMYqMRAWMap5lLnGP+Z04av9g cwEwPsXStcCboOtOHIrRzFz/lUFaXDS5/C9MV5AYY5+QBBu+r/0noeXcsOJu1y74qa wppbiCFwmSgCBAs5XYn3YTBKh2/t70peztJrUD0d3CYQsBuUlrgb2OKaf64KEqCbsM OqdpfbrRPZ8lg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Adrian Hunter , Ulf Hansson Subject: [PATCH v2 5/7] mmc: sdhci-pltfm: use devm_ioremap_resource() Date: Wed, 20 Apr 2016 11:16:29 +0900 Message-Id: <1461118591-21595-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461118591-21595-1-git-send-email-yamada.masahiro@socionext.com> References: <1461118591-21595-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The chain of devm_request_mem_region() and devm_ioremap() can be replaced with devm_ioremap_resource(). Also, we can drop the error messages because devm_ioremap_resource() displays similar messages on error. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/sdhci-pltfm.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 5213287..caa05d7 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -152,19 +152,9 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, goto err_request; } - if (!devm_request_mem_region(&pdev->dev, iomem->start, - resource_size(iomem), - mmc_hostname(host->mmc))) { - dev_err(&pdev->dev, "cannot request region\n"); - ret = -EBUSY; - goto err_request; - } - - host->ioaddr = devm_ioremap(&pdev->dev, iomem->start, - resource_size(iomem)); - if (!host->ioaddr) { - dev_err(&pdev->dev, "failed to remap registers\n"); - ret = -ENOMEM; + host->ioaddr = devm_ioremap_resource(&pdev->dev, iomem); + if (IS_ERR(host->ioaddr)) { + ret = PTR_ERR(host->ioaddr); goto err_request; }