diff options
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/fec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index f174070646f5..dafd797a6069 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c | |||
@@ -1507,11 +1507,17 @@ static int __devinit fec_get_phy_mode_dt(struct platform_device *pdev) | |||
1507 | static void __devinit fec_reset_phy(struct platform_device *pdev) | 1507 | static void __devinit fec_reset_phy(struct platform_device *pdev) |
1508 | { | 1508 | { |
1509 | int err, phy_reset; | 1509 | int err, phy_reset; |
1510 | int msec = 1; | ||
1510 | struct device_node *np = pdev->dev.of_node; | 1511 | struct device_node *np = pdev->dev.of_node; |
1511 | 1512 | ||
1512 | if (!np) | 1513 | if (!np) |
1513 | return; | 1514 | return; |
1514 | 1515 | ||
1516 | of_property_read_u32(np, "phy-reset-duration", &msec); | ||
1517 | /* A sane reset duration should not be longer than 1s */ | ||
1518 | if (msec > 1000) | ||
1519 | msec = 1; | ||
1520 | |||
1515 | phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0); | 1521 | phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0); |
1516 | err = devm_gpio_request_one(&pdev->dev, phy_reset, | 1522 | err = devm_gpio_request_one(&pdev->dev, phy_reset, |
1517 | GPIOF_OUT_INIT_LOW, "phy-reset"); | 1523 | GPIOF_OUT_INIT_LOW, "phy-reset"); |
@@ -1519,7 +1525,7 @@ static void __devinit fec_reset_phy(struct platform_device *pdev) | |||
1519 | pr_debug("FEC: failed to get gpio phy-reset: %d\n", err); | 1525 | pr_debug("FEC: failed to get gpio phy-reset: %d\n", err); |
1520 | return; | 1526 | return; |
1521 | } | 1527 | } |
1522 | msleep(1); | 1528 | msleep(msec); |
1523 | gpio_set_value(phy_reset, 1); | 1529 | gpio_set_value(phy_reset, 1); |
1524 | } | 1530 | } |
1525 | #else /* CONFIG_OF */ | 1531 | #else /* CONFIG_OF */ |