From patchwork Fri Nov 24 16:24:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10074349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 07233602DC for ; Fri, 24 Nov 2017 16:32:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECE8D2990F for ; Fri, 24 Nov 2017 16:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E00262A2C9; Fri, 24 Nov 2017 16:32:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FB072990F for ; Fri, 24 Nov 2017 16:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753692AbdKXQcP (ORCPT ); Fri, 24 Nov 2017 11:32:15 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61428 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753608AbdKXQZ6 (ORCPT ); Fri, 24 Nov 2017 11:25:58 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vp007100; Sat, 25 Nov 2017 01:25:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vp007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540714; bh=qNDBWcc9eLtyjEBtYQmQYpRZXNOZsO7GQak4tSmLjps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T9mPaBm9R+UjF/OXwA66E2Qbf5KIVupdjaNjfWZxwBGSzfcBNSHKQcO3OzqWLzvF5 kJFcrycQnwijhfPdjnZo4GSlvzoXWaZSQTWGel3DTLm/mghdKXQnl0dRFeHYPO2C9l pyJRCm30GDphKUqIreYxfC68NS7pXj0mFHnNwKusmqLYqbDxfu20jxajf7F3XmlXC3 sGGGnfcSklYm2GCsChBq40j3ywWOgM+gX6pLg27GBKfF3v2h7YAMpYv9dZV6r7RDDV aZ4b6jfkZgI3AptSjgdRIhjea7bpoBqWtxGFdlLnX7Ozm8vLksBX9tIdu3l4IK17zC Wz9/GVT4F2oEA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 05/22] mmc: tmio: use devm_ioremap_resource() instead of devm_ioremap() Date: Sat, 25 Nov 2017 01:24:40 +0900 Message-Id: <1511540697-27387-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-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-Virus-Scanned: ClamAV using ClamSMTP The TMIO core misses to call request_mem_region(). devm_ioremap_resource() takes care of it and makes the code cleaner. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 12df338..d3b7af9 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1185,8 +1185,9 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, _host->write16_hook = NULL; res_ctl = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res_ctl) - return -EINVAL; + _host->ctl = devm_ioremap_resource(&pdev->dev, res_ctl); + if (IS_ERR(_host->ctl)) + return PTR_ERR(_host->ctl); ret = mmc_of_parse(mmc); if (ret < 0) @@ -1202,11 +1203,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, if (ret < 0) return ret; - _host->ctl = devm_ioremap(&pdev->dev, - res_ctl->start, resource_size(res_ctl)); - if (!_host->ctl) - return -ENOMEM; - tmio_mmc_ops.card_busy = _host->card_busy; tmio_mmc_ops.start_signal_voltage_switch = _host->start_signal_voltage_switch;