summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hip04_eth.c
diff options
context:
space:
mode:
authorJiangfeng Xiao <xiaojiangfeng@huawei.com>2019-07-12 16:16:24 +0300
committerDavid S. Miller <davem@davemloft.net>2019-07-13 01:37:18 +0300
commit56170ba3bd90986e44f96ada9573dfe583621fca (patch)
tree0cd8961ed9968d6a0ba6d02e09916d0669cef89b /drivers/net/ethernet/hisilicon/hip04_eth.c
parent752c2ea2d8e7c23b0f64e2e7d4337f3604d44c9f (diff)
downloadlinux-56170ba3bd90986e44f96ada9573dfe583621fca.tar.xz
net: hisilicon: Use devm_platform_ioremap_resource
Use devm_platform_ioremap_resource instead of devm_ioremap_resource. Make the code simpler. Signed-off-by: Jiangfeng Xiao <xiaojiangfeng@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hip04_eth.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hip04_eth.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index 625635771b83..d60452845539 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;