Skip to content

Commit 0e55a95

Browse files
maass-hamburgkartben
authored andcommitted
drivers: ethernet: esp32: move net_if_carrier_off()
move net_if_carrier_off() before phy_link_callback_set() to ensure the carrier is not truned off, when the link is already up. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
1 parent b74feaa commit 0e55a95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/ethernet/eth_esp32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,14 @@ static void eth_esp32_iface_init(struct net_if *iface)
375375
ethernet_init(iface);
376376

377377
if (device_is_ready(eth_esp32_phy_dev)) {
378+
/* Do not start the interface until PHY link is up */
379+
net_if_carrier_off(iface);
380+
378381
phy_link_callback_set(eth_esp32_phy_dev, phy_link_state_changed,
379382
(void *)dev);
380383
} else {
381384
LOG_ERR("PHY device not ready");
382385
}
383-
384-
/* Do not start the interface until PHY link is up */
385-
net_if_carrier_off(iface);
386386
}
387387

388388
static const struct ethernet_api eth_esp32_api = {

0 commit comments

Comments
 (0)