ar71xx: ag71xx: don't start/stop built-in switch w/o mii_bus_dev
[openwrt/staging/hauke.git] / target / linux / ar71xx / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_phy.c
index ebdbc5b9ac2a8b66a6592dc6ba103af87dab2b70..ce9edc1f743ea97f2de0f1db289a597844baf5bb 100644 (file)
@@ -48,7 +48,7 @@ void ag71xx_phy_start(struct ag71xx *ag)
 
        if (ag->phy_dev) {
                phy_start(ag->phy_dev);
-       } else if (pdata->switch_data) {
+       } else if (pdata->mii_bus_dev && pdata->switch_data) {
                ag71xx_ar7240_start(ag);
        } else {
                ag->link = 1;
@@ -63,7 +63,7 @@ void ag71xx_phy_stop(struct ag71xx *ag)
 
        if (ag->phy_dev)
                phy_stop(ag->phy_dev);
-       else if (pdata->switch_data)
+       else if (pdata->mii_bus_dev && pdata->switch_data)
                ag71xx_ar7240_stop(ag);
 
        spin_lock_irqsave(&ag->lock, flags);