phy: nop-phy: Fix phy reset if no reset-gpio defined
Ensure there is a valid reset-gpio defined before using it.
Fixes: f9852acdce
("phy: nop-phy: Fix enabling reset")
Cc: Adam Ford <aford173@gmail.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
This commit is contained in:
parent
f9a719e295
commit
a41b88ec02
1 changed files with 7 additions and 5 deletions
|
@ -45,11 +45,13 @@ static int nop_phy_init(struct phy *phy)
|
||||||
|
|
||||||
#if CONFIG_IS_ENABLED(DM_GPIO)
|
#if CONFIG_IS_ENABLED(DM_GPIO)
|
||||||
/* Take phy out of reset */
|
/* Take phy out of reset */
|
||||||
ret = dm_gpio_set_value(&priv->reset_gpio, false);
|
if (dm_gpio_is_valid(&priv->reset_gpio)) {
|
||||||
if (ret) {
|
ret = dm_gpio_set_value(&priv->reset_gpio, false);
|
||||||
if (CONFIG_IS_ENABLED(CLK))
|
if (ret) {
|
||||||
clk_disable_bulk(&priv->bulk);
|
if (CONFIG_IS_ENABLED(CLK))
|
||||||
return ret;
|
clk_disable_bulk(&priv->bulk);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue