diff --git a/package/kernel/mt76/patches/001-fix-mt76-driver-build-with-kernel-5.15.patch b/package/kernel/mt76/patches/001-fix-mt76-driver-build-with-kernel-5.15.patch new file mode 100644 index 000000000..de4018e7e --- /dev/null +++ b/package/kernel/mt76/patches/001-fix-mt76-driver-build-with-kernel-5.15.patch @@ -0,0 +1,34 @@ +From b450c426085843114e443fd63c342f52544d00f3 Mon Sep 17 00:00:00 2001 +From: W_Y_CPP <383152993@qq.com> +Date: Mon, 28 Feb 2022 21:19:03 -0500 +Subject: [PATCH] fix mt76 driver build with kernel 5.15 + +--- + eeprom.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/eeprom.c b/eeprom.c +index cc74c372d..975a0c0bd 100644 +--- a/eeprom.c ++++ b/eeprom.c +@@ -95,10 +95,15 @@ mt76_eeprom_override(struct mt76_phy *phy) + struct device_node *np = dev->dev->of_node; + const u8 *mac = NULL; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) ++ if (np) ++ of_get_mac_address(np, phy->macaddr); ++#else + if (np) + mac = of_get_mac_address(np); +- if (!IS_ERR_OR_NULL(mac)) +- ether_addr_copy(phy->macaddr, mac); ++ if (!IS_ERR_OR_NULL(mac)) ++ ether_addr_copy(phy->macaddr, mac); ++#endif + #endif + + if (!is_valid_ether_addr(phy->macaddr)) { +-- +2.17.1 +