Skip to content

Commit dd166f8

Browse files
committed
drivers: net: sam_gmac: remove run once check in update eth_iface_init()
To allow every interface be initialized properly when there are more than one instance, remove the static variable "init_done" which is used to make the initialize procedure only be done once. Signed-off-by: Tony Han <[email protected]>
1 parent 408a696 commit dd166f8

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

drivers/ethernet/eth_sam_gmac.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,6 @@ static void eth_iface_init(struct net_if *iface)
17371737
const struct device *dev = net_if_get_device(iface);
17381738
struct eth_sam_dev_data *const dev_data = dev->data;
17391739
const struct eth_sam_dev_cfg *const cfg = dev->config;
1740-
static bool init_done;
17411740
uint32_t gmac_ncfgr_val;
17421741
int result;
17431742
int i;
@@ -1748,11 +1747,6 @@ static void eth_iface_init(struct net_if *iface)
17481747

17491748
ethernet_init(iface);
17501749

1751-
/* The rest of initialization should only be done once */
1752-
if (init_done) {
1753-
return;
1754-
}
1755-
17561750
/* Check the status of data caches */
17571751
dcache_is_enabled();
17581752

@@ -1842,8 +1836,6 @@ static void eth_iface_init(struct net_if *iface)
18421836
} else {
18431837
LOG_ERR("%s PHY device not ready", dev->name);
18441838
}
1845-
1846-
init_done = true;
18471839
}
18481840

18491841
static enum ethernet_hw_caps eth_sam_gmac_get_capabilities(const struct device *dev)

0 commit comments

Comments
 (0)