mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-06-01 16:38:32 +08:00
mt76: fix build error on 6.12 kernel
This commit is contained in:
parent
cd7c4fd158
commit
e2600d9329
@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=mt76
|
PKG_NAME:=mt76
|
||||||
PKG_RELEASE=2
|
PKG_RELEASE=3
|
||||||
|
|
||||||
PKG_LICENSE:=GPLv2
|
PKG_LICENSE:=GPLv2
|
||||||
PKG_LICENSE_FILES:=
|
PKG_LICENSE_FILES:=
|
||||||
|
@ -0,0 +1,98 @@
|
|||||||
|
From: Shiji Yang <yangshiji66@outlook.com>
|
||||||
|
Date: Mon, 28 Apr 2025 22:16:03 +0800
|
||||||
|
Subject: [PATCH] wifi: mt76: convert platform driver .remove to .remove_new
|
||||||
|
|
||||||
|
This conversion can make the mt76 driver compatible with both
|
||||||
|
the 6.6 and 6.12 kernels. Fixes build error on 6.12:
|
||||||
|
|
||||||
|
/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/mt76-2025.04.11~be28ef77/mt7603/soc.c:77:27: error: initialization of 'void (*)(struct platform_device *)' from incompatible pointer type 'int (*)(struct platform_device *)' [-Werror=incompatible-pointer-types]
|
||||||
|
77 | .remove = mt76_wmac_remove,
|
||||||
|
| ^~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||||
|
---
|
||||||
|
mt7603/soc.c | 6 ++----
|
||||||
|
mt7615/soc.c | 6 ++----
|
||||||
|
mt7915/soc.c | 6 ++----
|
||||||
|
3 files changed, 6 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
--- a/mt7603/soc.c
|
||||||
|
+++ b/mt7603/soc.c
|
||||||
|
@@ -52,15 +52,13 @@ error:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int
|
||||||
|
+static void
|
||||||
|
mt76_wmac_remove(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
struct mt76_dev *mdev = platform_get_drvdata(pdev);
|
||||||
|
struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76);
|
||||||
|
|
||||||
|
mt7603_unregister_device(dev);
|
||||||
|
-
|
||||||
|
- return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct of_device_id of_wmac_match[] = {
|
||||||
|
@@ -74,7 +72,7 @@ MODULE_FIRMWARE(MT7628_FIRMWARE_E2);
|
||||||
|
|
||||||
|
struct platform_driver mt76_wmac_driver = {
|
||||||
|
.probe = mt76_wmac_probe,
|
||||||
|
- .remove = mt76_wmac_remove,
|
||||||
|
+ .remove_new = mt76_wmac_remove,
|
||||||
|
.driver = {
|
||||||
|
.name = "mt76_wmac",
|
||||||
|
.of_match_table = of_wmac_match,
|
||||||
|
--- a/mt7615/soc.c
|
||||||
|
+++ b/mt7615/soc.c
|
||||||
|
@@ -45,13 +45,11 @@ static int mt7622_wmac_probe(struct plat
|
||||||
|
return mt7615_mmio_probe(&pdev->dev, mem_base, irq, mt7615e_reg_map);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int mt7622_wmac_remove(struct platform_device *pdev)
|
||||||
|
+static void mt7622_wmac_remove(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
struct mt7615_dev *dev = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
|
mt7615_unregister_device(dev);
|
||||||
|
-
|
||||||
|
- return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct of_device_id mt7622_wmac_of_match[] = {
|
||||||
|
@@ -65,7 +63,7 @@ struct platform_driver mt7622_wmac_drive
|
||||||
|
.of_match_table = mt7622_wmac_of_match,
|
||||||
|
},
|
||||||
|
.probe = mt7622_wmac_probe,
|
||||||
|
- .remove = mt7622_wmac_remove,
|
||||||
|
+ .remove_new = mt7622_wmac_remove,
|
||||||
|
};
|
||||||
|
|
||||||
|
MODULE_FIRMWARE(MT7622_FIRMWARE_N9);
|
||||||
|
--- a/mt7915/soc.c
|
||||||
|
+++ b/mt7915/soc.c
|
||||||
|
@@ -1283,13 +1283,11 @@ free_device:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int mt798x_wmac_remove(struct platform_device *pdev)
|
||||||
|
+static void mt798x_wmac_remove(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
struct mt7915_dev *dev = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
|
mt7915_unregister_device(dev);
|
||||||
|
-
|
||||||
|
- return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct of_device_id mt798x_wmac_of_match[] = {
|
||||||
|
@@ -1306,7 +1304,7 @@ struct platform_driver mt798x_wmac_drive
|
||||||
|
.of_match_table = mt798x_wmac_of_match,
|
||||||
|
},
|
||||||
|
.probe = mt798x_wmac_probe,
|
||||||
|
- .remove = mt798x_wmac_remove,
|
||||||
|
+ .remove_new = mt798x_wmac_remove,
|
||||||
|
};
|
||||||
|
|
||||||
|
MODULE_FIRMWARE(MT7986_FIRMWARE_WA);
|
Loading…
x
Reference in New Issue
Block a user