diff options
author | Madalin Bucur <madalin.bucur@oss.nxp.com> | 2020-03-05 20:08:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-09 08:02:54 +0300 |
commit | f3353b99022583cc17142146cdc4dd6a770fbc7f (patch) | |
tree | 7e4381ae0eb16f1e3ccee1ea8ed01edb4398d705 /drivers/net/ethernet/freescale/fman/fman_tgec.c | |
parent | 6b995bdefc10b47e4d443b3a5dafb92f5bb09268 (diff) | |
download | linux-f3353b99022583cc17142146cdc4dd6a770fbc7f.tar.xz |
fsl/fman: tolerate missing MAC address in device tree
Allow the initialization of the MAC to be performed even if the
device tree does not provide a valid MAC address. Later a random
MAC address should be assigned by the Ethernet driver.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman/fman_tgec.c')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/fman_tgec.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index f75b9c11b2d2..8c7eb878d5b4 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -273,10 +273,6 @@ static int check_init_parameters(struct fman_mac *tgec) pr_err("10G MAC driver only support 10G speed\n"); return -EINVAL; } - if (tgec->addr == 0) { - pr_err("Ethernet 10G MAC Must have valid MAC Address\n"); - return -EINVAL; - } if (!tgec->exception_cb) { pr_err("uninitialized exception_cb\n"); return -EINVAL; @@ -706,8 +702,10 @@ int tgec_init(struct fman_mac *tgec) cfg = tgec->cfg; - MAKE_ENET_ADDR_FROM_UINT64(tgec->addr, eth_addr); - set_mac_address(tgec->regs, (u8 *)eth_addr); + if (tgec->addr) { + MAKE_ENET_ADDR_FROM_UINT64(tgec->addr, eth_addr); + set_mac_address(tgec->regs, (u8 *)eth_addr); + } /* interrupts */ /* FM_10G_REM_N_LCL_FLT_EX_10GMAC_ERRATA_SW005 Errata workaround */ |