lede/package/kernel/mt76/patches/001-fix-mt76-driver-build-with-kernel-5.15.patch
2022-03-01 23:04:58 +08:00

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);