From patchwork Thu Apr 14 02:29:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 8830571 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 461D8C0553 for ; Thu, 14 Apr 2016 02:30:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70CA220295 for ; Thu, 14 Apr 2016 02:30:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88DFB20274 for ; Thu, 14 Apr 2016 02:30:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753749AbcDNC3p (ORCPT ); Wed, 13 Apr 2016 22:29:45 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:40983 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753726AbcDNC3m (ORCPT ); Wed, 13 Apr 2016 22:29:42 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id u3E2Sr3g010961; Thu, 14 Apr 2016 11:28:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u3E2Sr3g010961 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1460600938; bh=LDcoN7N/UIV3zi449QVMP0xFp09DUFgja0f3Es1WHiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2S+Bthmu7npeq/5x6PGNBtVhpofAO4tSk3jYh8JoazLbBOXCiZui5ZSkvyuPxyueK LZNKiNGzANrl0D6kfvQtfBmMbYbsOKFKi59hkY828+DnyAVhmiFcirIRSvlbpD+CbI Ul2fsnMwqkwOwxS0VYIjbObbwnpOfq7hlNAJ1eRD9cKLwqb/TbN9z34FdUU93OiV12 yA/0wjVTDQS7JKtn8B5JR76XSxlkM5akVXL6ZjoS+TwAxrfj+hVwG1Ac+QNHQvuTt6 p2Dr2hLQsp8+LTy3iHngDIO093fT39SnvfpUynD70o74PvwB1tNdbAjtU/TtzO/ItH A7PDIOV3A9ung== 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 5/7] mmc: sdhci-pltfm: use devm_ioremap_resource() Date: Thu, 14 Apr 2016 11:29:48 +0900 Message-Id: <1460600990-10993-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460600990-10993-1-git-send-email-yamada.masahiro@socionext.com> References: <1460600990-10993-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 --- 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 c81a72d..94955e1 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -158,19 +158,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; }