developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 1 | From 7aa9a88eabbde806abfd12b184da25962e436c39 Mon Sep 17 00:00:00 2001 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Tue, 13 Dec 2022 10:51:46 +0800 |
| 4 | Subject: [PATCH 4000/4002] mt76: revert get_of_mac_addr |
| 5 | |
| 6 | --- |
| 7 | eeprom.c | 8 +++++++- |
| 8 | 1 file changed, 7 insertions(+), 1 deletion(-) |
| 9 | |
| 10 | diff --git a/eeprom.c b/eeprom.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 11 | index 6290156f..306c6412 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 12 | --- a/eeprom.c |
| 13 | +++ b/eeprom.c |
| 14 | @@ -126,9 +126,15 @@ void |
| 15 | mt76_eeprom_override(struct mt76_phy *phy) |
| 16 | { |
| 17 | struct mt76_dev *dev = phy->dev; |
| 18 | +#ifdef CONFIG_OF |
| 19 | struct device_node *np = dev->dev->of_node; |
| 20 | + const u8 *mac = NULL; |
| 21 | |
| 22 | - of_get_mac_address(np, phy->macaddr); |
| 23 | + if (np) |
| 24 | + mac = of_get_mac_address(np); |
| 25 | + if (!IS_ERR_OR_NULL(mac)) |
| 26 | + ether_addr_copy(phy->macaddr, mac); |
| 27 | +#endif |
| 28 | |
| 29 | if (!is_valid_ether_addr(phy->macaddr)) { |
| 30 | eth_random_addr(phy->macaddr); |
| 31 | -- |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 32 | 2.18.0 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 33 | |