mirror of
https://github.com/Heleguo/lede.git
synced 2025-12-16 19:01:32 +00:00
mac80211: fix wxcore and hwsim build with kernel 6.12
This commit is contained in:
parent
f15a3cd196
commit
4ffd32fee0
119
package/kernel/mac80211/patches/build/901-fix-wxcore-6.12.patch
Normal file
119
package/kernel/mac80211/patches/build/901-fix-wxcore-6.12.patch
Normal file
@ -0,0 +1,119 @@
|
||||
From f00928012886a07ca6817ea70eb4856ce280ce05 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
|
||||
Date: Tue, 12 Sep 2023 19:12:49 +0200
|
||||
Subject: [PATCH] wifi: wlcore: Convert to platform remove callback returning
|
||||
void
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The .remove() callback for a platform driver returns an int which makes
|
||||
many driver authors wrongly assume it's possible to do error handling by
|
||||
returning an error code. However the value returned is (mostly) ignored
|
||||
and this typically results in resource leaks. To improve here there is a
|
||||
quest to make the remove callback return void. In the first step of this
|
||||
quest all drivers are converted to .remove_new() which already returns
|
||||
void.
|
||||
|
||||
wlcore_remove() returned zero unconditionally. With that converted to
|
||||
return void instead, the wl12xx and wl18xx driver can be converted to
|
||||
.remove_new trivially.
|
||||
|
||||
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
|
||||
Signed-off-by: Kalle Valo <kvalo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20230912171249.755901-1-u.kleine-koenig@pengutronix.de
|
||||
---
|
||||
drivers/net/wireless/ti/wl12xx/main.c | 6 +++---
|
||||
drivers/net/wireless/ti/wl18xx/main.c | 2 +-
|
||||
drivers/net/wireless/ti/wlcore/main.c | 6 ++----
|
||||
drivers/net/wireless/ti/wlcore/wlcore.h | 2 +-
|
||||
4 files changed, 7 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
|
||||
index d06a2c4194479a..de045fe4ca1eb9 100644
|
||||
--- a/drivers/net/wireless/ti/wl12xx/main.c
|
||||
+++ b/drivers/net/wireless/ti/wl12xx/main.c
|
||||
@@ -1919,7 +1919,7 @@ static int wl12xx_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int wl12xx_remove(struct platform_device *pdev)
|
||||
+static void wl12xx_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct wl1271 *wl = platform_get_drvdata(pdev);
|
||||
struct wl12xx_priv *priv;
|
||||
@@ -1928,7 +1928,7 @@ static int wl12xx_remove(struct platform_device *pdev)
|
||||
|
||||
kfree(priv->rx_mem_addr);
|
||||
|
||||
- return wlcore_remove(pdev);
|
||||
+ wlcore_remove(pdev);
|
||||
}
|
||||
|
||||
static const struct platform_device_id wl12xx_id_table[] = {
|
||||
@@ -1939,7 +1939,7 @@ MODULE_DEVICE_TABLE(platform, wl12xx_id_table);
|
||||
|
||||
static struct platform_driver wl12xx_driver = {
|
||||
.probe = wl12xx_probe,
|
||||
- .remove = wl12xx_remove,
|
||||
+ .remove_new = wl12xx_remove,
|
||||
.id_table = wl12xx_id_table,
|
||||
.driver = {
|
||||
.name = "wl12xx_driver",
|
||||
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
|
||||
index 0b3cf8477c6cde..d4a89401f2c474 100644
|
||||
--- a/drivers/net/wireless/ti/wl18xx/main.c
|
||||
+++ b/drivers/net/wireless/ti/wl18xx/main.c
|
||||
@@ -2033,7 +2033,7 @@ MODULE_DEVICE_TABLE(platform, wl18xx_id_table);
|
||||
|
||||
static struct platform_driver wl18xx_driver = {
|
||||
.probe = wl18xx_probe,
|
||||
- .remove = wlcore_remove,
|
||||
+ .remove_new = wlcore_remove,
|
||||
.id_table = wl18xx_id_table,
|
||||
.driver = {
|
||||
.name = "wl18xx_driver",
|
||||
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
|
||||
index b7e68d2721c145..448c478a0fdd49 100644
|
||||
--- a/drivers/net/wireless/ti/wlcore/main.c
|
||||
+++ b/drivers/net/wireless/ti/wlcore/main.c
|
||||
@@ -6737,7 +6737,7 @@ int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(wlcore_probe);
|
||||
|
||||
-int wlcore_remove(struct platform_device *pdev)
|
||||
+void wlcore_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
|
||||
struct wl1271 *wl = platform_get_drvdata(pdev);
|
||||
@@ -6752,7 +6752,7 @@ int wlcore_remove(struct platform_device *pdev)
|
||||
if (pdev_data->family && pdev_data->family->nvs_name)
|
||||
wait_for_completion(&wl->nvs_loading_complete);
|
||||
if (!wl->initialized)
|
||||
- return 0;
|
||||
+ return;
|
||||
|
||||
if (wl->wakeirq >= 0) {
|
||||
dev_pm_clear_wake_irq(wl->dev);
|
||||
@@ -6772,8 +6772,6 @@ int wlcore_remove(struct platform_device *pdev)
|
||||
|
||||
free_irq(wl->irq, wl);
|
||||
wlcore_free_hw(wl);
|
||||
-
|
||||
- return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(wlcore_remove);
|
||||
|
||||
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
|
||||
index 81c94d390623b0..1f8511bf9bb358 100644
|
||||
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
|
||||
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
|
||||
@@ -497,7 +497,7 @@ struct wl1271 {
|
||||
};
|
||||
|
||||
int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
|
||||
-int wlcore_remove(struct platform_device *pdev);
|
||||
+void wlcore_remove(struct platform_device *pdev);
|
||||
struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
|
||||
u32 mbox_size);
|
||||
int wlcore_free_hw(struct wl1271 *wl);
|
||||
@ -0,0 +1,16 @@
|
||||
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
|
||||
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
|
||||
@@ -6411,8 +6411,13 @@
|
||||
[HWSIM_VQ_RX] = "rx",
|
||||
};
|
||||
|
||||
+#if LINUX_VERSION_IS_LESS(6,12,0)
|
||||
return virtio_find_vqs(vdev, HWSIM_NUM_VQS,
|
||||
hwsim_vqs, callbacks, names, NULL);
|
||||
+#else
|
||||
+ return virtio_find_vqs(vdev, HWSIM_NUM_VQS,
|
||||
+ hwsim_vqs, vqs_info, NULL);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static int fill_vq(struct virtqueue *vq)
|
||||
Loading…
Reference in New Issue
Block a user