build/patch/misc/wireless-xradio-5.13.patch

38 lines
1.2 KiB
Diff
Raw Normal View History

diff --git a/drivers/net/wireless/xradio/main.c b/drivers/net/wireless/xradio/main.c
index 2b76ede90..272afad2b 100644
--- a/drivers/net/wireless/xradio/main.c
+++ b/drivers/net/wireless/xradio/main.c
@@ -503,7 +503,11 @@ int xradio_core_init(struct sdio_func* func)
struct ieee80211_hw *dev;
struct xradio_common *hw_priv;
unsigned char randomaddr[ETH_ALEN];
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
const unsigned char *addr = NULL;
+#else
+ unsigned char addr[ETH_ALEN] = {0};
+#endif
//init xradio_common
dev = xradio_init_common(sizeof(struct xradio_common));
@@ -518,12 +522,20 @@ int xradio_core_init(struct sdio_func* func)
// fill in mac addresses
if (hw_priv->pdev->of_node) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
addr = of_get_mac_address(hw_priv->pdev->of_node);
+#else
+ int ret = of_get_mac_address(hw_priv->pdev->of_node, addr);
+#endif
}
if (!addr) {
dev_warn(hw_priv->pdev, "no mac address provided, using random\n");
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
eth_random_addr(randomaddr);
addr = randomaddr;
+#else
+ eth_random_addr(addr);
+#endif
}
for (b = 0; b < XRWL_MAX_VIFS; b++) { /* MRK 5.5a */
memcpy(hw_priv->addresses[b].addr, addr, ETH_ALEN);