blob: 5fcce4ad274e8d4c52da26b05534da35ba9d899d [file] [log] [blame]
From 1b370c429b7193202f6b3df50bd72500b4ec4581 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Tue, 13 Dec 2022 10:51:46 +0800
Subject: [PATCH 4001/4003] mt76: revert get_of_mac_addr
---
eeprom.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/eeprom.c b/eeprom.c
index d161264..1f29cf9 100644
--- a/eeprom.c
+++ b/eeprom.c
@@ -128,9 +128,15 @@ void
mt76_eeprom_override(struct mt76_phy *phy)
{
struct mt76_dev *dev = phy->dev;
+#ifdef CONFIG_OF
struct device_node *np = dev->dev->of_node;
+ const u8 *mac = NULL;
- of_get_mac_address(np, phy->macaddr);
+ if (np)
+ mac = of_get_mac_address(np);
+ if (!IS_ERR_OR_NULL(mac))
+ ether_addr_copy(phy->macaddr, mac);
+#endif
if (!is_valid_ether_addr(phy->macaddr)) {
eth_random_addr(phy->macaddr);
--
2.36.1