aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-07-21 12:25:03 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-22 19:50:31 -0400
commit399db75b2cc62aa67d465158b11fafca9ca9b408 (patch)
treee3600278aad69631b1a8c594b85ca3e923522736
parent13a097bd35a15bbec00479adfb2ef5360e8eabef (diff)
fec: Remove unneeded check in platform_get_resource()
As devm_ioremap_resource() is used, there is no need to explicitely check the return value from platform_get_resource(), as this is something that devm_ioremap_resource() takes care by itself. Also, place platform_get_resource() prior to devm_ioremap_resource() for better code readability. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fc2cccd887ea..e69760eb4095 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2033,10 +2033,6 @@ fec_probe(struct platform_device *pdev)
2033 if (of_id) 2033 if (of_id)
2034 pdev->id_entry = of_id->data; 2034 pdev->id_entry = of_id->data;
2035 2035
2036 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2037 if (!r)
2038 return -ENXIO;
2039
2040 /* Init network device */ 2036 /* Init network device */
2041 ndev = alloc_etherdev(sizeof(struct fec_enet_private)); 2037 ndev = alloc_etherdev(sizeof(struct fec_enet_private));
2042 if (!ndev) 2038 if (!ndev)
@@ -2054,6 +2050,7 @@ fec_probe(struct platform_device *pdev)
2054 fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG; 2050 fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG;
2055#endif 2051#endif
2056 2052
2053 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2057 fep->hwp = devm_ioremap_resource(&pdev->dev, r); 2054 fep->hwp = devm_ioremap_resource(&pdev->dev, r);
2058 if (IS_ERR(fep->hwp)) { 2055 if (IS_ERR(fep->hwp)) {
2059 ret = PTR_ERR(fep->hwp); 2056 ret = PTR_ERR(fep->hwp);