mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
mt76: fix build with kernel 5.15
This commit is contained in:
parent
68da7390fb
commit
20a437026a
@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=mt76
|
PKG_NAME:=mt76
|
||||||
PKG_RELEASE=5
|
PKG_RELEASE=6
|
||||||
|
|
||||||
PKG_LICENSE:=GPLv2
|
PKG_LICENSE:=GPLv2
|
||||||
PKG_LICENSE_FILES:=
|
PKG_LICENSE_FILES:=
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
--- 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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user