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;
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);