mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
22 lines
509 B
Diff
22 lines
509 B
Diff
--- a/eeprom.c
|
|
+++ b/eeprom.c
|
|
@@ -91,6 +91,10 @@
|
|
{
|
|
struct mt76_dev *dev = phy->dev;
|
|
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
|
+ struct device_node *np = dev->dev->of_node;
|
|
+ of_get_mac_address(np, phy->macaddr);
|
|
+#else
|
|
#ifdef CONFIG_OF
|
|
struct device_node *np = dev->dev->of_node;
|
|
const u8 *mac = NULL;
|
|
@@ -100,6 +104,7 @@
|
|
if (!IS_ERR_OR_NULL(mac))
|
|
ether_addr_copy(phy->macaddr, mac);
|
|
#endif
|
|
+#endif
|
|
|
|
if (!is_valid_ether_addr(phy->macaddr)) {
|
|
eth_random_addr(phy->macaddr);
|
|
|