aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-09-22 22:12:46 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-23 13:55:25 -0400
commita9b2c8ef1585e1f14cec03777b1238e0d5ec4ea1 (patch)
tree24ea8257f0c80308ac57e016c86437cfdc6b285d /drivers/net/ethernet/freescale
parentf04ea74e8aa5b95610bcd2fcb110ffa2ec665dcc (diff)
net/fec: fec_reset_phy() does not need to always succeed
FEC can work without a phy reset on some platforms, which means not very platform necessarily have a phy-reset gpio encoded in device tree. Even on the platforms that have the gpio, FEC can work without resetting phy for some cases, e.g. boot loader has done that. So it makes more sense to have the phy-reset-gpio request failure as a debug message rather than a warning, and get fec_reset_phy() return void since the caller does not check the return anyway. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/fec.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 158b82ea6df5..9c1d0594895c 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1411,24 +1411,22 @@ static int __devinit fec_get_phy_mode_dt(struct platform_device *pdev)
1411 return -ENODEV; 1411 return -ENODEV;
1412} 1412}
1413 1413
1414static int __devinit fec_reset_phy(struct platform_device *pdev) 1414static void __devinit fec_reset_phy(struct platform_device *pdev)
1415{ 1415{
1416 int err, phy_reset; 1416 int err, phy_reset;
1417 struct device_node *np = pdev->dev.of_node; 1417 struct device_node *np = pdev->dev.of_node;
1418 1418
1419 if (!np) 1419 if (!np)
1420 return -ENODEV; 1420 return;
1421 1421
1422 phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0); 1422 phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
1423 err = gpio_request_one(phy_reset, GPIOF_OUT_INIT_LOW, "phy-reset"); 1423 err = gpio_request_one(phy_reset, GPIOF_OUT_INIT_LOW, "phy-reset");
1424 if (err) { 1424 if (err) {
1425 pr_warn("FEC: failed to get gpio phy-reset: %d\n", err); 1425 pr_debug("FEC: failed to get gpio phy-reset: %d\n", err);
1426 return err; 1426 return;
1427 } 1427 }
1428 msleep(1); 1428 msleep(1);
1429 gpio_set_value(phy_reset, 1); 1429 gpio_set_value(phy_reset, 1);
1430
1431 return 0;
1432} 1430}
1433#else /* CONFIG_OF */ 1431#else /* CONFIG_OF */
1434static inline int fec_get_phy_mode_dt(struct platform_device *pdev) 1432static inline int fec_get_phy_mode_dt(struct platform_device *pdev)
@@ -1436,13 +1434,12 @@ static inline int fec_get_phy_mode_dt(struct platform_device *pdev)
1436 return -ENODEV; 1434 return -ENODEV;
1437} 1435}
1438 1436
1439static inline int fec_reset_phy(struct platform_device *pdev) 1437static inline void fec_reset_phy(struct platform_device *pdev)
1440{ 1438{
1441 /* 1439 /*
1442 * In case of platform probe, the reset has been done 1440 * In case of platform probe, the reset has been done
1443 * by machine code. 1441 * by machine code.
1444 */ 1442 */
1445 return 0;
1446} 1443}
1447#endif /* CONFIG_OF */ 1444#endif /* CONFIG_OF */
1448 1445