提交 399db75b 编写于 作者: F Fabio Estevam 提交者: David S. Miller

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: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 13a097bd
...@@ -2033,10 +2033,6 @@ fec_probe(struct platform_device *pdev) ...@@ -2033,10 +2033,6 @@ fec_probe(struct platform_device *pdev)
if (of_id) if (of_id)
pdev->id_entry = of_id->data; pdev->id_entry = of_id->data;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r)
return -ENXIO;
/* Init network device */ /* Init network device */
ndev = alloc_etherdev(sizeof(struct fec_enet_private)); ndev = alloc_etherdev(sizeof(struct fec_enet_private));
if (!ndev) if (!ndev)
...@@ -2054,6 +2050,7 @@ fec_probe(struct platform_device *pdev) ...@@ -2054,6 +2050,7 @@ fec_probe(struct platform_device *pdev)
fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG; fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG;
#endif #endif
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
fep->hwp = devm_ioremap_resource(&pdev->dev, r); fep->hwp = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(fep->hwp)) { if (IS_ERR(fep->hwp)) {
ret = PTR_ERR(fep->hwp); ret = PTR_ERR(fep->hwp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册