Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp889914ybi; Fri, 12 Jul 2019 06:17:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0thxjjBGdr/OO2MkyZpCZUMyV/rG0BAC9ZzpsrBpq+aRK6gr79W/gAI5l9csjaT3Jioy5 X-Received: by 2002:a63:e20a:: with SMTP id q10mr10639921pgh.24.1562937441023; Fri, 12 Jul 2019 06:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562937441; cv=none; d=google.com; s=arc-20160816; b=dAScHL5gs4RYHRGnVzS5ReNH71N5xpyVuC87YErGJeHGwGZmpQ9SJsljS4KH+z0vN7 Fwlv2Yh0LNtX07WT86Kbs7+j4u69r0xu1NAgLWFXy8iNpmsv4+tKGDtJ+ZUP3/thc3aB 31Mzbd7xJN9m83M5x38sH+bSEipjSKq9pMHAl2sgIxGnj9FZXmdXM1SxY2GOgS9tlAbU zyjW1MxivyH+OG9tmo9QvI9rN/WIe5wdjLmRHRODkJ4MNpuDWrcBltVlztBcLtPn0Xs5 WBWW+3KZUNmz+5CTi6UvyDtQNtlVAhaiq1fjmrvHEJv8bNSgfF6HNRq/39Hs0nGyWRL1 tyCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=mTBvpuKVn7SbTrwriivapjauNhxTaHx/VkW+OPwsjbo=; b=eVIb+7ghaG2EwgS44Pi8W2vOcEoOK8FL1AqVU+X2y83JikXXPeZyQqx+/aGFBJDu9F A9urnhGfInn/KgenIu6YiA55jg96co8Whhlf8R8wRuyJm2zBsV6zU6pksxF8gXll139B cbSHPm4vMubcrlHNbmOMEtMlF42o8sKaHWXet9HRWeFM5hPjjpuyww7LTjIOtESbwVB8 OSjMAW4YmfazO1wWOFm5GRsZuZKo9NHBqB00SUsnMS05C7YzZulqVmheTLBMQ4gWso7g Zl+aCCo763eZWcCSCBvIJBlreoAho7mmOaBRJafsKEmZlRq5WrYSK7YY1dltTX1/iEQo KY7g== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x139si3810982pgx.251.2019.07.12.06.17.04; Fri, 12 Jul 2019 06:17:21 -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; 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 S1727488AbfGLNQo (ORCPT + 99 others); Fri, 12 Jul 2019 09:16:44 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:56694 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727189AbfGLNQn (ORCPT ); Fri, 12 Jul 2019 09:16:43 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id EE4DE11277CF686DA60C; Fri, 12 Jul 2019 21:16:40 +0800 (CST) Received: from huawei.com (10.67.189.167) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Fri, 12 Jul 2019 21:16:31 +0800 From: Jiangfeng Xiao To: , , , CC: , , , , Subject: [PATCH] net: hisilicon: Use devm_platform_ioremap_resource Date: Fri, 12 Jul 2019 21:16:24 +0800 Message-ID: <1562937384-121710-1-git-send-email-xiaojiangfeng@huawei.com> X-Mailer: git-send-email 1.8.5.6 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.167] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_platform_ioremap_resource instead of devm_ioremap_resource. Make the code simpler. Signed-off-by: Jiangfeng Xiao --- drivers/net/ethernet/hisilicon/hip04_eth.c | 7 ++----- drivers/net/ethernet/hisilicon/hisi_femac.c | 7 ++----- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 7 ++----- drivers/net/ethernet/hisilicon/hns_mdio.c | 4 +--- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c index 6256357..d604528 100644 --- a/drivers/net/ethernet/hisilicon/hip04_eth.c +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c @@ -899,7 +899,6 @@ static int hip04_mac_probe(struct platform_device *pdev) struct of_phandle_args arg; struct net_device *ndev; struct hip04_priv *priv; - struct resource *res; int irq; int ret; @@ -912,16 +911,14 @@ static int hip04_mac_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ndev); SET_NETDEV_DEV(ndev, &pdev->dev); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base = devm_ioremap_resource(d, res); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) { ret = PTR_ERR(priv->base); goto init_fail; } #if defined(CONFIG_HI13X1_GMAC) - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - priv->sysctrl_base = devm_ioremap_resource(d, res); + priv->sysctrl_base = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(priv->sysctrl_base)) { ret = PTR_ERR(priv->sysctrl_base); goto init_fail; diff --git a/drivers/net/ethernet/hisilicon/hisi_femac.c b/drivers/net/ethernet/hisilicon/hisi_femac.c index d2e019d..689f18e 100644 --- a/drivers/net/ethernet/hisilicon/hisi_femac.c +++ b/drivers/net/ethernet/hisilicon/hisi_femac.c @@ -781,7 +781,6 @@ static int hisi_femac_drv_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; - struct resource *res; struct net_device *ndev; struct hisi_femac_priv *priv; struct phy_device *phy; @@ -799,15 +798,13 @@ static int hisi_femac_drv_probe(struct platform_device *pdev) priv->dev = dev; priv->ndev = ndev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->port_base = devm_ioremap_resource(dev, res); + priv->port_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->port_base)) { ret = PTR_ERR(priv->port_base); goto out_free_netdev; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - priv->glb_base = devm_ioremap_resource(dev, res); + priv->glb_base = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(priv->glb_base)) { ret = PTR_ERR(priv->glb_base); goto out_free_netdev; diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c index 89ef764..3499705 100644 --- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c +++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c @@ -1097,7 +1097,6 @@ static int hix5hd2_dev_probe(struct platform_device *pdev) const struct of_device_id *of_id = NULL; struct net_device *ndev; struct hix5hd2_priv *priv; - struct resource *res; struct mii_bus *bus; const char *mac_addr; int ret; @@ -1119,15 +1118,13 @@ static int hix5hd2_dev_probe(struct platform_device *pdev) } priv->hw_cap = (unsigned long)of_id->data; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base = devm_ioremap_resource(dev, res); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) { ret = PTR_ERR(priv->base); goto out_free_netdev; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - priv->ctrl_base = devm_ioremap_resource(dev, res); + priv->ctrl_base = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(priv->ctrl_base)) { ret = PTR_ERR(priv->ctrl_base); goto out_free_netdev; diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c index 918cab1..3e863a7 100644 --- a/drivers/net/ethernet/hisilicon/hns_mdio.c +++ b/drivers/net/ethernet/hisilicon/hns_mdio.c @@ -417,7 +417,6 @@ static int hns_mdio_probe(struct platform_device *pdev) { struct hns_mdio_device *mdio_dev; struct mii_bus *new_bus; - struct resource *res; int ret = -ENODEV; if (!pdev) { @@ -442,8 +441,7 @@ static int hns_mdio_probe(struct platform_device *pdev) new_bus->priv = mdio_dev; new_bus->parent = &pdev->dev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mdio_dev->vbase = devm_ioremap_resource(&pdev->dev, res); + mdio_dev->vbase = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mdio_dev->vbase)) { ret = PTR_ERR(mdio_dev->vbase); return ret; -- 1.8.5.6