|
@@ -177,12 +177,18 @@ void cpsw_phy_sel(struct device *dev, phy_interface_t phy_mode, int slave)
|
|
|
}
|
|
|
|
|
|
dev = bus_find_device(&platform_bus_type, NULL, node, match);
|
|
|
- of_node_put(node);
|
|
|
+ if (!dev) {
|
|
|
+ dev_err(dev, "unable to find platform device for %pOF\n", node);
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
priv = dev_get_drvdata(dev);
|
|
|
|
|
|
priv->cpsw_phy_sel(priv, phy_mode, slave);
|
|
|
|
|
|
put_device(dev);
|
|
|
+out:
|
|
|
+ of_node_put(node);
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(cpsw_phy_sel);
|
|
|
|