diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-07-21 13:25:03 -0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-22 16:50:31 -0700 |
commit | 399db75b2cc62aa67d465158b11fafca9ca9b408 (patch) | |
tree | e3600278aad69631b1a8c594b85ca3e923522736 | |
parent | 13a097bd35a15bbec00479adfb2ef5360e8eabef (diff) | |
download | op-kernel-dev-399db75b2cc62aa67d465158b11fafca9ca9b408.zip op-kernel-dev-399db75b2cc62aa67d465158b11fafca9ca9b408.tar.gz |
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.c | 5 |
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 fc2cccd..e69760e 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) if (of_id) pdev->id_entry = of_id->data; - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!r) - return -ENXIO; - /* Init network device */ ndev = alloc_etherdev(sizeof(struct fec_enet_private)); if (!ndev) @@ -2054,6 +2050,7 @@ fec_probe(struct platform_device *pdev) fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG; #endif + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); fep->hwp = devm_ioremap_resource(&pdev->dev, r); if (IS_ERR(fep->hwp)) { ret = PTR_ERR(fep->hwp); |