@@ -1060,10 +1060,12 @@ static int eqos_init(struct udevice *dev)
debug("%s(dev=%p):\n", __func__, dev);
- ret = eqos->config->ops->eqos_start_clks(dev);
- if (ret < 0) {
- pr_err("eqos_start_clks() failed: %d", ret);
- goto err;
+ if (eqos->config->ops->eqos_start_clks) {
+ ret = eqos->config->ops->eqos_start_clks(dev);
+ if (ret < 0) {
+ pr_err("eqos_start_clks() failed: %d", ret);
+ goto err;
+ }
}
ret = eqos->config->ops->eqos_start_resets(dev);
@@ -1146,7 +1148,8 @@ err_shutdown_phy:
err_stop_resets:
eqos->config->ops->eqos_stop_resets(dev);
err_stop_clks:
- eqos->config->ops->eqos_stop_clks(dev);
+ if (eqos->config->ops->eqos_stop_clks)
+ eqos->config->ops->eqos_stop_clks(dev);
err:
pr_err("FAILED: %d", ret);
return ret;
@@ -1427,7 +1430,8 @@ static void eqos_stop(struct udevice *dev)
phy_shutdown(eqos->phy);
}
eqos->config->ops->eqos_stop_resets(dev);
- eqos->config->ops->eqos_stop_clks(dev);
+ if (eqos->config->ops->eqos_stop_clks)
+ eqos->config->ops->eqos_stop_clks(dev);
debug("%s: OK\n", __func__);
}
If there are definitions for eqos_start_clks and eqos_stop_clks, then call these callback function. Signed-off-by: David Wu <david.wu at rock-chips.com> --- Changes in v2: - None drivers/net/dwc_eth_qos.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)