diff options
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index b10fedd82143..8212b2b93422 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -378,6 +378,20 @@ void phy_disconnect(struct phy_device *phydev) | |||
378 | } | 378 | } |
379 | EXPORT_SYMBOL(phy_disconnect); | 379 | EXPORT_SYMBOL(phy_disconnect); |
380 | 380 | ||
381 | int phy_init_hw(struct phy_device *phydev) | ||
382 | { | ||
383 | int ret; | ||
384 | |||
385 | if (!phydev->drv || !phydev->drv->config_init) | ||
386 | return 0; | ||
387 | |||
388 | ret = phy_scan_fixups(phydev); | ||
389 | if (ret < 0) | ||
390 | return ret; | ||
391 | |||
392 | return phydev->drv->config_init(phydev); | ||
393 | } | ||
394 | |||
381 | /** | 395 | /** |
382 | * phy_attach_direct - attach a network device to a given PHY device pointer | 396 | * phy_attach_direct - attach a network device to a given PHY device pointer |
383 | * @dev: network device to attach | 397 | * @dev: network device to attach |
@@ -425,21 +439,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
425 | /* Do initial configuration here, now that | 439 | /* Do initial configuration here, now that |
426 | * we have certain key parameters | 440 | * we have certain key parameters |
427 | * (dev_flags and interface) */ | 441 | * (dev_flags and interface) */ |
428 | if (phydev->drv->config_init) { | 442 | return phy_init_hw(phydev); |
429 | int err; | ||
430 | |||
431 | err = phy_scan_fixups(phydev); | ||
432 | |||
433 | if (err < 0) | ||
434 | return err; | ||
435 | |||
436 | err = phydev->drv->config_init(phydev); | ||
437 | |||
438 | if (err < 0) | ||
439 | return err; | ||
440 | } | ||
441 | |||
442 | return 0; | ||
443 | } | 443 | } |
444 | EXPORT_SYMBOL(phy_attach_direct); | 444 | EXPORT_SYMBOL(phy_attach_direct); |
445 | 445 | ||