Commit a9b2c8ef authored by Shawn Guo's avatar Shawn Guo Committed by David S. Miller

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: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f04ea74e
...@@ -1411,24 +1411,22 @@ static int __devinit fec_get_phy_mode_dt(struct platform_device *pdev) ...@@ -1411,24 +1411,22 @@ static int __devinit fec_get_phy_mode_dt(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
static int __devinit fec_reset_phy(struct platform_device *pdev) static void __devinit fec_reset_phy(struct platform_device *pdev)
{ {
int err, phy_reset; int err, phy_reset;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
if (!np) if (!np)
return -ENODEV; return;
phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0); phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
err = gpio_request_one(phy_reset, GPIOF_OUT_INIT_LOW, "phy-reset"); err = gpio_request_one(phy_reset, GPIOF_OUT_INIT_LOW, "phy-reset");
if (err) { if (err) {
pr_warn("FEC: failed to get gpio phy-reset: %d\n", err); pr_debug("FEC: failed to get gpio phy-reset: %d\n", err);
return err; return;
} }
msleep(1); msleep(1);
gpio_set_value(phy_reset, 1); gpio_set_value(phy_reset, 1);
return 0;
} }
#else /* CONFIG_OF */ #else /* CONFIG_OF */
static inline int fec_get_phy_mode_dt(struct platform_device *pdev) static 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,13 +1434,12 @@ static inline int fec_get_phy_mode_dt(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
static inline int fec_reset_phy(struct platform_device *pdev) static inline void fec_reset_phy(struct platform_device *pdev)
{ {
/* /*
* In case of platform probe, the reset has been done * In case of platform probe, the reset has been done
* by machine code. * by machine code.
*/ */
return 0;
} }
#endif /* CONFIG_OF */ #endif /* CONFIG_OF */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment