Commit 596cd64b authored by Fin Maaß's avatar Fin Maaß Committed by Benjamin Cabé
Browse files

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: default avatarFin Maaß <f.maass@vogl-electronic.com>
parent 5f83aea9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 = &eth_dwc_xgmac##port##_rx_desc[0u][0u],                             \
+1 −1
Original line number Diff line number Diff line
@@ -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};                                                            \
+1 −1
Original line number Diff line number Diff line
@@ -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),       \
	};                                                                                         \
+2 −1
Original line number Diff line number Diff line
@@ -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)),                  \
+1 −1
Original line number Diff line number Diff line
@@ -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 = {                                \
Loading