Merge branch 'drm-fixes-3.18' of git://people.freedesktop.org/~agd5f/linux into drm...
[cascardo/linux.git] / net / dsa / slave.c
index a851e9f..ab03e00 100644 (file)
@@ -489,11 +489,14 @@ static void dsa_slave_phy_setup(struct dsa_slave_priv *p,
        /* We could not connect to a designated PHY, so use the switch internal
         * MDIO bus instead
         */
-       if (!p->phy)
+       if (!p->phy) {
                p->phy = ds->slave_mii_bus->phy_map[p->port];
-       else
+               phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
+                                  p->phy_interface);
+       } else {
                pr_info("attached PHY at address %d [%s]\n",
                        p->phy->addr, p->phy->drv->name);
+       }
 }
 
 int dsa_slave_suspend(struct net_device *slave_dev)
@@ -599,7 +602,7 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
        netif_carrier_off(slave_dev);
 
        if (p->phy != NULL) {
-               if (ds->drv->get_phy_flags(ds, port))
+               if (ds->drv->get_phy_flags)
                        p->phy->dev_flags |= ds->drv->get_phy_flags(ds, port);
 
                phy_attach(slave_dev, dev_name(&p->phy->dev),