diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 3f7f1522cc42..85ccc237972f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -356,8 +356,8 @@ int stmmac_mdio_idle(struct mii_bus *bus) reset_gpio = devm_gpiod_get_optional(priv->device, "snps,reset", GPIOD_OUT_HIGH); - if (IS_ERR(reset_gpio)) - return PTR_ERR(reset_gpio); + if (IS_ERR_OR_NULL(reset_gpio)) + return PTR_ERR_OR_ZERO(reset_gpio); devm_gpiod_put(priv->device, reset_gpio); } @@ -386,8 +386,8 @@ int stmmac_mdio_reset(struct mii_bus *bus) reset_gpio = devm_gpiod_get_optional(priv->device, "snps,reset", GPIOD_OUT_LOW); - if (IS_ERR(reset_gpio)) - return PTR_ERR(reset_gpio); + if (IS_ERR_OR_NULL(reset_gpio)) + return PTR_ERR_OR_ZERO(reset_gpio); device_property_read_u32_array(priv->device, "snps,reset-delays-us",