Skip to content

Commit a6537c6

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 <tony.han@microchip.com>
1 parent bc4ca67 commit a6537c6

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
@@ -1739,7 +1739,6 @@ static void eth_iface_init(struct net_if *iface)
17391739
const struct device *dev = net_if_get_device(iface);
17401740
struct eth_sam_dev_data *const dev_data = dev->data;
17411741
const struct eth_sam_dev_cfg *const cfg = dev->config;
1742-
static bool init_done;
17431742
uint32_t gmac_ncfgr_val;
17441743
int result;
17451744
int i;
@@ -1750,11 +1749,6 @@ static void eth_iface_init(struct net_if *iface)
17501749

17511750
ethernet_init(iface);
17521751

1753-
/* The rest of initialization should only be done once */
1754-
if (init_done) {
1755-
return;
1756-
}
1757-
17581752
/* Check the status of data caches */
17591753
dcache_is_enabled();
17601754

@@ -1844,8 +1838,6 @@ static void eth_iface_init(struct net_if *iface)
18441838
} else {
18451839
LOG_ERR("%s PHY device not ready", dev->name);
18461840
}
1847-
1848-
init_done = true;
18491841
}
18501842

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

0 commit comments

Comments
 (0)