[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1374423904-2668-6-git-send-email-festevam@gmail.com>
Date: Sun, 21 Jul 2013 13:25:03 -0300
From: Fabio Estevam <festevam@...il.com>
To: davem@...emloft.net
Cc: kernel@...gutronix.de, Frank.Li@...escale.com,
shawn.guo@...aro.org, netdev@...r.kernel.org,
Fabio Estevam <fabio.estevam@...escale.com>
Subject: [PATCH 5/6] fec: Remove unneeded check in platform_get_resource()
From: Fabio Estevam <fabio.estevam@...escale.com>
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@...escale.com>
---
drivers/net/ethernet/freescale/fec_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index acc1850..03028c4 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);
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists