Skip to content

Commit 3237fd2

Browse files
maass-hamburgkartben
authored andcommitted
drivers: ethernet: atmel_sam_gmac: 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 ddfb390 commit 3237fd2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/ethernet/eth_sam_gmac.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,18 +1901,15 @@ static void eth0_iface_init(struct net_if *iface)
19011901
#endif
19021902
#endif
19031903
if (device_is_ready(cfg->phy_dev)) {
1904+
net_if_carrier_off(iface);
1905+
19041906
phy_link_callback_set(cfg->phy_dev, &phy_link_state_changed,
19051907
(void *)dev);
19061908

19071909
} else {
19081910
LOG_ERR("PHY device not ready");
19091911
}
19101912

1911-
/* Do not start the interface until PHY link is up */
1912-
if (!(dev_data->link_up)) {
1913-
net_if_carrier_off(iface);
1914-
}
1915-
19161913
init_done = true;
19171914
}
19181915

0 commit comments

Comments
 (0)