drivers: ethernet: use DT_INST_PROP_OR for local-mac-address
use DT_INST_PROP_OR for local-mac-address, so that it is not required to be set in dt, as there are other ways to se the mac address. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit is contained in:
parent
5f83aea9e4
commit
596cd64bb9
@ -1699,7 +1699,7 @@ static const struct ethernet_api eth_dwc_xgmac_apis = {
|
||||
/* Device run-time data declaration macro */
|
||||
#define ETH_DWC_XGMAC_DEV_DATA(port) \
|
||||
static struct eth_dwc_xgmac_dev_data eth_dwc_xgmac##port##_dev_data = { \
|
||||
.mac_addr = DT_INST_PROP(port, local_mac_address), \
|
||||
.mac_addr = DT_INST_PROP_OR(port, local_mac_address, {0}), \
|
||||
.link_speed = DT_INST_PROP(port, max_speed), \
|
||||
.enable_full_duplex = DT_INST_PROP(port, full_duplex_mode_en), \
|
||||
.dma_rx_desc = ð_dwc_xgmac##port##_rx_desc[0u][0u], \
|
||||
|
||||
@ -472,7 +472,7 @@ static const struct ethernet_api lan865x_api_func = {
|
||||
struct oa_tc6 oa_tc6_##inst = { \
|
||||
.cps = 64, .protected = 0, .spi = &lan865x_config_##inst.spi}; \
|
||||
static struct lan865x_data lan865x_data_##inst = { \
|
||||
.mac_address = DT_INST_PROP(inst, local_mac_address), \
|
||||
.mac_address = DT_INST_PROP_OR(inst, local_mac_address, {0}), \
|
||||
.tx_rx_sem = Z_SEM_INITIALIZER((lan865x_data_##inst).tx_rx_sem, 1, 1), \
|
||||
.int_sem = Z_SEM_INITIALIZER((lan865x_data_##inst).int_sem, 0, 1), \
|
||||
.tc6 = &oa_tc6_##inst}; \
|
||||
|
||||
@ -702,7 +702,7 @@ static int lan9250_init(const struct device *dev)
|
||||
|
||||
#define LAN9250_DEFINE(inst) \
|
||||
static struct lan9250_runtime lan9250_##inst##_runtime = { \
|
||||
.mac_address = DT_INST_PROP(inst, local_mac_address), \
|
||||
.mac_address = DT_INST_PROP_OR(inst, local_mac_address, {0}), \
|
||||
.tx_rx_sem = Z_SEM_INITIALIZER(lan9250_##inst##_runtime.tx_rx_sem, 1, UINT_MAX), \
|
||||
.int_sem = Z_SEM_INITIALIZER(lan9250_##inst##_runtime.int_sem, 0, UINT_MAX), \
|
||||
}; \
|
||||
|
||||
@ -331,7 +331,8 @@ static const struct ethernet_api eth_api = {
|
||||
} \
|
||||
\
|
||||
static struct eth_litex_dev_data eth_data##n = { \
|
||||
.mac_addr = DT_INST_PROP(n, local_mac_address)}; \
|
||||
.mac_addr = DT_INST_PROP_OR(n, local_mac_address, {0}), \
|
||||
}; \
|
||||
\
|
||||
static const struct eth_litex_config eth_config##n = { \
|
||||
.phy_dev = DEVICE_DT_GET_OR_NULL(DT_INST_PHANDLE(n, phy_handle)), \
|
||||
|
||||
@ -586,7 +586,7 @@ static const struct ethernet_api xilinx_axienet_api = {
|
||||
} \
|
||||
\
|
||||
static struct xilinx_axienet_data data_##inst = { \
|
||||
.mac_addr = DT_INST_PROP(inst, local_mac_address), \
|
||||
.mac_addr = DT_INST_PROP_OR(inst, local_mac_address, {0}), \
|
||||
.dma_is_configured_rx = false, \
|
||||
.dma_is_configured_tx = false}; \
|
||||
static const struct xilinx_axienet_config config_##inst = { \
|
||||
|
||||
@ -476,7 +476,7 @@ static const struct eth_xlnx_gem_dev_cfg eth_xlnx_gem##port##_dev_cfg = {\
|
||||
/* Device run-time data declaration macro */
|
||||
#define ETH_XLNX_GEM_DEV_DATA(port) \
|
||||
static struct eth_xlnx_gem_dev_data eth_xlnx_gem##port##_dev_data = {\
|
||||
.mac_addr = DT_INST_PROP(port, local_mac_address),\
|
||||
.mac_addr = DT_INST_PROP_OR(port, local_mac_address, {0}),\
|
||||
.started = 0,\
|
||||
.eff_link_speed = LINK_DOWN,\
|
||||
.phy_addr = 0,\
|
||||
|
||||
Loading…
Reference in New Issue
Block a user