From patchwork Thu Apr 14 02:29:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 65771 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp346947qge; Wed, 13 Apr 2016 19:29:45 -0700 (PDT) X-Received: by 10.66.40.236 with SMTP id a12mr17710213pal.58.1460600985423; Wed, 13 Apr 2016 19:29:45 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l90si4572232pfb.194.2016.04.13.19.29.45; Wed, 13 Apr 2016 19:29:45 -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 S1753704AbcDNC3g (ORCPT + 29 others); Wed, 13 Apr 2016 22:29:36 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:40504 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbcDNC33 (ORCPT ); Wed, 13 Apr 2016 22:29:29 -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 u3E2Sr3e010961; Thu, 14 Apr 2016 11:28:56 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u3E2Sr3e010961 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1460600936; bh=0H/qhRv7fhl3uVl+0B/jgQPENaYhmXQU/Wd+MbuI4iQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fjezfroHrmi1FMFHz5qlyQ0LwXU8pAfa7ldCTxgjQ3I3/gzSs1bBmYcqlXMHRbGss vHjgXPZHdFc4hu5v5ZYWB8LijBf3wkJTf9kB30WBpbP/eEnyRBeaY+k37onnn4W9bM DEZ6NSqrMe9vfQXIC4Bp6jbMyGaWh01yPNC9/MDApUNK9KqA3Z4YA93NcWeJQnIj2F VBsBqpFkQkMAAAEAeMOVHR2GFFlRdGK/aDruo5ZEZz0p/9uGyZdjf1OVFZKX/QJ3V4 j6Jo6Zr2YWeC+jBj/1E0Id1i+emmJ+uZhqpJ8vUlNBJrwV3uPAk7U78qyReb7Ub6zA Muzbfw1rzo8xA== 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 3/7] mmc: sdhci-pltfm: use devm_request_mem_region() Date: Thu, 14 Apr 2016 11:29:46 +0900 Message-Id: <1460600990-10993-4-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the managed variant of request_mem_region(). Signed-off-by: Masahiro Yamada --- drivers/mmc/host/sdhci-pltfm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 3354a53..e4da44a 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -158,8 +158,9 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, goto err_request; } - if (!request_mem_region(iomem->start, resource_size(iomem), - mmc_hostname(host->mmc))) { + 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; @@ -169,7 +170,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, if (!host->ioaddr) { dev_err(&pdev->dev, "failed to remap registers\n"); ret = -ENOMEM; - goto err_remap; + goto err_request; } /* @@ -183,8 +184,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, return host; -err_remap: - release_mem_region(iomem->start, resource_size(iomem)); err_request: sdhci_free_host(host); err: @@ -196,10 +195,8 @@ EXPORT_SYMBOL_GPL(sdhci_pltfm_init); void sdhci_pltfm_free(struct platform_device *pdev) { struct sdhci_host *host = platform_get_drvdata(pdev); - struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); iounmap(host->ioaddr); - release_mem_region(iomem->start, resource_size(iomem)); sdhci_free_host(host); } EXPORT_SYMBOL_GPL(sdhci_pltfm_free);