aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index b10fedd82143..adbc0fded130 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -177,6 +177,7 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
177 dev->state = PHY_DOWN; 177 dev->state = PHY_DOWN;
178 178
179 mutex_init(&dev->lock); 179 mutex_init(&dev->lock);
180 INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine);
180 181
181 return dev; 182 return dev;
182} 183}
@@ -378,6 +379,20 @@ void phy_disconnect(struct phy_device *phydev)
378} 379}
379EXPORT_SYMBOL(phy_disconnect); 380EXPORT_SYMBOL(phy_disconnect);
380 381
382int phy_init_hw(struct phy_device *phydev)
383{
384 int ret;
385
386 if (!phydev->drv || !phydev->drv->config_init)
387 return 0;
388
389 ret = phy_scan_fixups(phydev);
390 if (ret < 0)
391 return ret;
392
393 return phydev->drv->config_init(phydev);
394}
395
381/** 396/**
382 * phy_attach_direct - attach a network device to a given PHY device pointer 397 * phy_attach_direct - attach a network device to a given PHY device pointer
383 * @dev: network device to attach 398 * @dev: network device to attach
@@ -425,21 +440,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
425 /* Do initial configuration here, now that 440 /* Do initial configuration here, now that
426 * we have certain key parameters 441 * we have certain key parameters
427 * (dev_flags and interface) */ 442 * (dev_flags and interface) */
428 if (phydev->drv->config_init) { 443 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} 444}
444EXPORT_SYMBOL(phy_attach_direct); 445EXPORT_SYMBOL(phy_attach_direct);
445 446