Merge tag 'ecryptfs-3.11-rc1-cleanup' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / drivers / net / phy / phy_device.c
index 3657b4a..74630e9 100644 (file)
@@ -189,6 +189,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
 
        mutex_init(&dev->lock);
        INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine);
+       INIT_WORK(&dev->phy_queue, phy_change);
 
        /* Request the appropriate module unconditionally; don't
           bother trying to do so only if it isn't already loaded,
@@ -1009,10 +1010,16 @@ static int phy_probe(struct device *dev)
        phydrv = to_phy_driver(drv);
        phydev->drv = phydrv;
 
-       /* Disable the interrupt if the PHY doesn't support it */
-       if (!(phydrv->flags & PHY_HAS_INTERRUPT))
+       /* Disable the interrupt if the PHY doesn't support it
+        * but the interrupt is still a valid one
+        */
+       if (!(phydrv->flags & PHY_HAS_INTERRUPT) &&
+                       phy_interrupt_is_valid(phydev))
                phydev->irq = PHY_POLL;
 
+       if (phydrv->flags & PHY_IS_INTERNAL)
+               phydev->is_internal = true;
+
        mutex_lock(&phydev->lock);
 
        /* Start out supporting everything. Eventually,