net: fec: Convert to use devm_ioremap_resource
authorTushar Behera <tushar.behera@linaro.org>
Mon, 10 Jun 2013 11:35:05 +0000 (17:05 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Jun 2013 09:22:35 +0000 (02:22 -0700)
Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
CC: netdev@vger.kernel.org
CC: "David S. Miller" <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index fa4a68fc01cb1df571502b35eae4cd228a2fd48c..c540055e4f4f997dcca05fca914e272e62f1aabe 100644 (file)
@@ -1876,17 +1876,17 @@ fec_probe(struct platform_device *pdev)
            (pdev->id_entry->driver_data & FEC_QUIRK_HAS_GBIT))
                fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG;
 
-       fep->hwp = devm_request_and_ioremap(&pdev->dev, r);
+       fep->hwp = devm_ioremap_resource(&pdev->dev, r);
+       if (IS_ERR(fep->hwp)) {
+               ret = PTR_ERR(fep->hwp);
+               goto failed_ioremap;
+       }
+
        fep->pdev = pdev;
        fep->dev_id = dev_id++;
 
        fep->bufdesc_ex = 0;
 
-       if (!fep->hwp) {
-               ret = -ENOMEM;
-               goto failed_ioremap;
-       }
-
        platform_set_drvdata(pdev, ndev);
 
        ret = of_get_phy_mode(pdev->dev.of_node);