net: hisilicon: Use devm_platform_ioremap_resource
[linux-2.6-microblaze.git] / drivers / net / ethernet / hisilicon / hip04_eth.c
index 6256357..d604528 100644 (file)
@@ -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;