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: 8885221 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5C8BE9F39A for ; Wed, 20 Apr 2016 02:17:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81FB62015E for ; Wed, 20 Apr 2016 02:16:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9ABAA2025A for ; Wed, 20 Apr 2016 02:16:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754330AbcDTCQK (ORCPT ); Tue, 19 Apr 2016 22:16:10 -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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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(-) 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; }