From patchwork Tue Nov 7 08:09:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10045849 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 3052A6032D for ; Tue, 7 Nov 2017 08:11:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2089329EED for ; Tue, 7 Nov 2017 08:11:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1577B29FA5; Tue, 7 Nov 2017 08:11:58 +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 8A67829EED for ; Tue, 7 Nov 2017 08:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932540AbdKGIKy (ORCPT ); Tue, 7 Nov 2017 03:10:54 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:24880 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932504AbdKGIKx (ORCPT ); Tue, 7 Nov 2017 03:10:53 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id vA789u4L027191; Tue, 7 Nov 2017 17:09:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com vA789u4L027191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510042199; bh=UtGwWV9JnIFPiWjrQK60PuerJA+wMQcv8skk+f0OMac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lWVuYmddaygY8e0qDRXIPVdVfv+F6xRGklc7eMiuMbtVYUDfcg95GfH1EJ//1L0dj nwhQ8zpQB2iJQXiqgliesYO9Bv73YDlKVQlv7knuzn3BnvHKZI6SqENVPrUH+vhEXD UycAkTyHmgvWW/0Yjhel1Y66R3gEnhA0zTFu5BzlB7uL4+MFfZKP2CdvyMt5/WSsQa 6yuxZavpgguLC0MErFNGpNkXi1P9OBQzRQHgngRgmK9A0RtgrZtfnixZqwMXxUy54e 6RRJt51W6jPRXZRcyI/AJi6bmzYtFf8WMb+fqKrhm2vVf4FgpmbXu43Fj3b+0B7NvG LWxjFVP2fFG5Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Wolfram Sang , linux-mmc@vger.kernel.org Cc: Simon Horman , Yoshihiro Shimoda , Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH 3/6] mmc: tmio: use devm_ioremap_resource() instead of devm_ioremap() Date: Tue, 7 Nov 2017 17:09:29 +0900 Message-Id: <1510042172-27220-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510042172-27220-1-git-send-email-yamada.masahiro@socionext.com> References: <1510042172-27220-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 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 --- 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 9b8ef73..0db6cac 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1182,8 +1182,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) @@ -1199,11 +1200,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;