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: 8830581 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 AE2E2C0553 for ; Thu, 14 Apr 2016 02:31:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D64AC20295 for ; Thu, 14 Apr 2016 02:31:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4CFE2017E for ; Thu, 14 Apr 2016 02:31:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753632AbcDNC3c (ORCPT ); Wed, 13 Apr 2016 22:29:32 -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-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 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(-) 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);