blob: 7a0aa1282eb6d2a6a73f4a809fba4e863cbc50f2 [file] [log] [blame]
From 5b3d131191690db907ee5c0ba43a80cb0f23b3bc 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/4005] 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 6e6d84e3..b2df0f44 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.18.0