diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c index 0eeb7b9a4e26..38eb18f0e9bb 100644 --- a/drivers/net/phy/air_en8811h.c +++ b/drivers/net/phy/air_en8811h.c @@ -1125,13 +1125,6 @@ static int an8811hb_probe(struct phy_device *phydev) if (ret) goto err_dev_create; - /* Configure led gpio pins as output */ - ret = air_phy_buckpbus_reg_modify(phydev, AN8811HB_GPIO_OUTPUT, - AN8811HB_GPIO_OUTPUT_345, - AN8811HB_GPIO_OUTPUT_345); - if (ret < 0) - goto err_dev_create; - return 0; err_dev_create: @@ -1265,9 +1258,15 @@ static int an8811hb_config_init(struct phy_device *phydev) ret = air_leds_init(phydev, EN8811H_LED_COUNT, AIR_PHY_LED_DUR, AIR_LED_MODE_USER_DEFINE); - if (ret < 0) + if (ret < 0) { phydev_err(phydev, "Failed to initialize leds: %d\n", ret); + return ret; + } + /* Restore LED GPIO output enables after MCU initialization. */ + ret = air_phy_buckpbus_reg_modify(phydev, AN8811HB_GPIO_OUTPUT, + AN8811HB_GPIO_OUTPUT_345, + AN8811HB_GPIO_OUTPUT_345); return ret; }