r8152: fix compatibility with kernel 5.4.251+

This commit is contained in:
coolsnowwolf 2023-08-21 13:36:36 +08:00
parent c5efeaff69
commit b1142d41f2

View File

@ -1,7 +1,7 @@
From f409f1cbfbeedc7b35b6651de9873e597f2f78e1 Mon Sep 17 00:00:00 2001 From f409f1cbfbeedc7b35b6651de9873e597f2f78e1 Mon Sep 17 00:00:00 2001
From: W_Y_CPP <383152993@qq.com> From: W_Y_CPP <383152993@qq.com>
Date: Thu, 10 Aug 2023 23:15:47 +0900 Date: Thu, 10 Aug 2023 23:15:47 +0900
Subject: [PATCH] rework eth hw addr set for kernel 5.x Subject: [PATCH] rework eth hw addr set for kernel 5.4
--- ---
src/compatibility.h | 2 ++ src/compatibility.h | 2 ++
@ -15,14 +15,15 @@ index 7738d17..25ffc39 100644
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0) */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0) */
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) */
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,12,0) */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,12,0) */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251) || LINUX_VERSION_CODE < KERNEL_VERSION(5,10,190)) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)
static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr) static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
{ {
memcpy(dev->dev_addr, addr, 6); memcpy(dev->dev_addr, addr, 6);
} }
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251) || LINUX_VERSION_CODE < KERNEL_VERSION(5,10,190) */ +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251) */
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) */
#ifndef FALSE #ifndef FALSE
-- --
2.17.1 2.17.1