Skip to contentSkip to conversation

wifi: rt2x00: add OF bindings + cleanup

PATCH Superseded Rosen Penev 3 participants 12 messages Jul 8, 2025 – Jul 9, 2025

Subsystems (5)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover wifi: rt2x00: add OF bindings + cleanup

It doesn't even compile. Added OF bindings, documentation, and other stuff to hopefully this doesn't happen again.

v2: move all of 2x00soc to 2800soc. I didn't realize only two functions remained for no good reason.
Fixed typos.
Slightly changed probe for clarity.

Rosen Penev (7):
wifi: rt2x00: add COMPILE_TEST
wifi: rt2x00: remove mod_name from platform_driver
wifi: rt2800soc: allow loading from OF
wifi: rt2800: move 2x00soc to 2800soc
wifi: rt2x00: soc: modernize probe
MIPS: dts: ralink: mt7620a: add wifi
dt-bindings: net: wireless: rt2800: add

 .../bindings/net/wireless/ralink,rt2800.yaml  |  47 ++++++
 arch/mips/boot/dts/ralink/mt7620a.dtsi        |  10 ++
 drivers/net/wireless/ralink/rt2x00/Kconfig    |   7 +-
 drivers/net/wireless/ralink/rt2x00/Makefile   |   1 -
 .../net/wireless/ralink/rt2x00/rt2800soc.c    | 102 +++++++++++-
 .../net/wireless/ralink/rt2x00/rt2x00soc.c    | 151 ------------------
 .../net/wireless/ralink/rt2x00/rt2x00soc.h    |  29 ----
 7 files changed, 156 insertions(+), 191 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ralink,rt2800.yaml
 delete mode 100644 drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
 delete mode 100644 drivers/net/wireless/ralink/rt2x00/rt2x00soc.h
Signature · 1 line
2.50.0
#1 lore raw

PATCH v2 1/7 wifi: rt2x00: add COMPILE_TEST

While this driver is for a specific arch, there is nothing preventing it from being compiled on other platforms.

Allows the various bots to test compilation and complain if a patch is bad.

---
 drivers/net/wireless/ralink/rt2x00/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/Kconfig +1 -1
index d1fd66d44a7e..3a32ceead54f 100644
@@ -202,7 +202,7 @@ endif
 
 config RT2800SOC
 	tristate "Ralink WiSoC support"
-	depends on SOC_RT288X || SOC_RT305X || SOC_MT7620
+	depends on SOC_RT288X || SOC_RT305X || SOC_MT7620 || COMPILE_TEST
 	select RT2X00_LIB_SOC
 	select RT2X00_LIB_MMIO
 	select RT2X00_LIB_CRYPTO
Signature · 1 line
2.50.0
#2 lore raw

PATCH v2 2/7 wifi: rt2x00: remove mod_name from platform_driver

In reply to Rosen Penev

mod_name is a legacy debugging feature with no real modern use. An analysis of the underlying MIPS setup code reveals it to also be unused.

---
 drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/rt2800soc.c +0 -1
index 701ba54bf3e5..e73394cf6ea6 100644
@@ -246,7 +246,6 @@ static int rt2800soc_probe(struct platform_device *pdev)
 static struct platform_driver rt2800soc_driver = {
 	.driver		= {
 		.name		= "rt2800_wmac",
-		.mod_name	= KBUILD_MODNAME,
 	},
 	.probe		= rt2800soc_probe,
 	.remove		= rt2x00soc_remove,
Signature · 1 line
2.50.0
#3 lore raw

PATCH v2 3/7 wifi: rt2800soc: allow loading from OF

In reply to Rosen Penev

Add a single binding to help the already present dts files load the driver. More are possible but there doesn't seem to be a significant difference between them to justify this.

Use wifi name per dtschema requirements.

The data field will be used to remove the custom non static probe function and use of_device_get_match_data.

---
 drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/wireless/ralink/rt2x00/rt2800soc.c +7 -0
index e73394cf6ea6..db8d01f0cdc3 100644
@@ -243,9 +243,16 @@ static int rt2800soc_probe(struct platform_device *pdev)
 	return rt2x00soc_probe(pdev, &rt2800soc_ops);
 }
 
+static const struct of_device_id rt2880_wmac_match[] = {
+	{ .compatible = "ralink,rt2880-wifi", .data = &rt2800soc_ops },
+	{},
+};
+MODULE_DEVICE_TABLE(of, rt2880_wmac_match);
+
 static struct platform_driver rt2800soc_driver = {
 	.driver		= {
 		.name		= "rt2800_wmac",
+		.of_match_table = rt2880_wmac_match,
 	},
 	.probe		= rt2800soc_probe,
 	.remove		= rt2x00soc_remove,
Signature · 1 line
2.50.0
#4 lore raw

PATCH v2 4/7 wifi: rt2800: move 2x00soc to 2800soc

In reply to Rosen Penev

This driver was written with multiple SOC platforms in mind. However since Ralink was aquired by Mediatek, it only effectively got used by older platforms. As such, we can slim down the driver slightly by moving all of rt2x00soc to rt2800soc in order to benefit from inlining.

---
 drivers/net/wireless/ralink/rt2x00/Kconfig    |   5 -
 drivers/net/wireless/ralink/rt2x00/Makefile   |   1 -
 .../net/wireless/ralink/rt2x00/rt2800soc.c    | 119 +++++++++++++-
 .../net/wireless/ralink/rt2x00/rt2x00soc.c    | 151 ------------------
 .../net/wireless/ralink/rt2x00/rt2x00soc.h    |  29 ----
 5 files changed, 118 insertions(+), 187 deletions(-)
 delete mode 100644 drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
 delete mode 100644 drivers/net/wireless/ralink/rt2x00/rt2x00soc.h
drivers/net/wireless/ralink/rt2x00/Kconfig +0 -5
index 3a32ceead54f..28530c1fac5c 100644
@@ -203,7 +203,6 @@ endif
 config RT2800SOC
 	tristate "Ralink WiSoC support"
 	depends on SOC_RT288X || SOC_RT305X || SOC_MT7620 || COMPILE_TEST
-	select RT2X00_LIB_SOC
 	select RT2X00_LIB_MMIO
 	select RT2X00_LIB_CRYPTO
 	select RT2X00_LIB_FIRMWARE
@@ -231,10 +230,6 @@ config RT2X00_LIB_PCI
 	tristate
 	select RT2X00_LIB
 
-config RT2X00_LIB_SOC
-	tristate
-	select RT2X00_LIB
-
 config RT2X00_LIB_USB
 	tristate
 	select RT2X00_LIB
drivers/net/wireless/ralink/rt2x00/Makefile +0 -1
index de030ebcdf6e..48d84d243606 100644
@@ -12,7 +12,6 @@ rt2x00lib-$(CONFIG_RT2X00_LIB_LEDS)	+= rt2x00leds.o
 obj-$(CONFIG_RT2X00_LIB)		+= rt2x00lib.o
 obj-$(CONFIG_RT2X00_LIB_MMIO)		+= rt2x00mmio.o
 obj-$(CONFIG_RT2X00_LIB_PCI)		+= rt2x00pci.o
-obj-$(CONFIG_RT2X00_LIB_SOC)		+= rt2x00soc.o
 obj-$(CONFIG_RT2X00_LIB_USB)		+= rt2x00usb.o
 obj-$(CONFIG_RT2800_LIB)		+= rt2800lib.o
 obj-$(CONFIG_RT2800_LIB_MMIO)		+= rt2800mmio.o
drivers/net/wireless/ralink/rt2x00/rt2800soc.c +118 -1

131 lines not on this page · raw message

drivers/net/wireless/ralink/rt2x00/rt2x00soc.c deleted +0 -151

151 lines not on this page · raw message

drivers/net/wireless/ralink/rt2x00/rt2x00soc.h deleted +0 -29
deleted file mode 100644
index d6226b8a10e0..000000000000
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
-	Copyright (C) 2004 - 2009 Ivo van Doorn <[email protected]>
-	<http://rt2x00.serialmonkey.com>
-
- */
-
-/*
-	Module: rt2x00soc
-	Abstract: Data structures for the rt2x00soc module.
- */
-
-#ifndef RT2X00SOC_H
-#define RT2X00SOC_H
-
-/*
- * SoC driver handlers.
- */
-int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops);
-void rt2x00soc_remove(struct platform_device *pdev);
-#ifdef CONFIG_PM
-int rt2x00soc_suspend(struct platform_device *pdev, pm_message_t state);
-int rt2x00soc_resume(struct platform_device *pdev);
-#else
-#define rt2x00soc_suspend	NULL
-#define rt2x00soc_resume	NULL
-#endif /* CONFIG_PM */
-
-#endif /* RT2X00SOC_H */
Signature · 1 line
2.50.0
#6 lore raw

PATCH v2 5/7 wifi: rt2x00: soc: modernize probe

In reply to Rosen Penev

Remove a bunch of static memory management functions and simplify with devm.

Also move allocation before ieee80211_alloc_hw to get rid of goto statements and clarify the error handling a bit more.

---
 .../net/wireless/ralink/rt2x00/rt2800soc.c    | 175 ++++++++----------
 1 file changed, 73 insertions(+), 102 deletions(-)
drivers/net/wireless/ralink/rt2x00/rt2800soc.c +73 -102
index a19906c35d0a..a238f7b9634a 100644
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 
 #include "rt2x00.h"
@@ -130,106 +131,6 @@ static int rt2800soc_write_firmware(struct rt2x00_dev *rt2x00dev,
 	return 0;
 }
 
-static void rt2x00soc_free_reg(struct rt2x00_dev *rt2x00dev)
-{
-	kfree(rt2x00dev->rf);
-	rt2x00dev->rf = NULL;
-
-	kfree(rt2x00dev->eeprom);
-	rt2x00dev->eeprom = NULL;
-
-	iounmap(rt2x00dev->csr.base);
-}
-
-static int rt2x00soc_alloc_reg(struct rt2x00_dev *rt2x00dev)
-{
-	struct platform_device *pdev = to_platform_device(rt2x00dev->dev);
-	struct resource *res;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
-
-	rt2x00dev->csr.base = ioremap(res->start, resource_size(res));
-	if (!rt2x00dev->csr.base)
-		return -ENOMEM;
-
-	rt2x00dev->eeprom = kzalloc(rt2x00dev->ops->eeprom_size, GFP_KERNEL);
-	if (!rt2x00dev->eeprom)
-		goto exit;
-
-	rt2x00dev->rf = kzalloc(rt2x00dev->ops->rf_size, GFP_KERNEL);
-	if (!rt2x00dev->rf)
-		goto exit;
-
-	return 0;
-
-exit:
-	rt2x00_probe_err("Failed to allocate registers\n");
-	rt2x00soc_free_reg(rt2x00dev);
-
-	return -ENOMEM;
-}
-
-static int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops)
-{
-	struct ieee80211_hw *hw;
-	struct rt2x00_dev *rt2x00dev;
-	int retval;
-
-	hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw);
-	if (!hw) {
-		rt2x00_probe_err("Failed to allocate hardware\n");
-		return -ENOMEM;
-	}
-
-	platform_set_drvdata(pdev, hw);
-
-	rt2x00dev = hw->priv;
-	rt2x00dev->dev = &pdev->dev;
-	rt2x00dev->ops = ops;
-	rt2x00dev->hw = hw;
-	rt2x00dev->irq = platform_get_irq(pdev, 0);
-	rt2x00dev->name = pdev->dev.driver->name;
-
-	rt2x00dev->clk = clk_get(&pdev->dev, NULL);
-	if (IS_ERR(rt2x00dev->clk))
-		rt2x00dev->clk = NULL;
-
-	rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC);
-
-	retval = rt2x00soc_alloc_reg(rt2x00dev);
-	if (retval)
-		goto exit_free_device;
-
-	retval = rt2x00lib_probe_dev(rt2x00dev);
-	if (retval)
-		goto exit_free_reg;
-
-	return 0;
-
-exit_free_reg:
-	rt2x00soc_free_reg(rt2x00dev);
-
-exit_free_device:
-	ieee80211_free_hw(hw);
-
-	return retval;
-}
-
-static void rt2x00soc_remove(struct platform_device *pdev)
-{
-	struct ieee80211_hw *hw = platform_get_drvdata(pdev);
-	struct rt2x00_dev *rt2x00dev = hw->priv;
-
-	/*
-	 * Free all allocated data.
-	 */
-	rt2x00lib_remove_dev(rt2x00dev);
-	rt2x00soc_free_reg(rt2x00dev);
-	ieee80211_free_hw(hw);
-}
-
 #ifdef CONFIG_PM
 static int rt2x00soc_suspend(struct platform_device *pdev, pm_message_t state)
 {
@@ -357,7 +258,77 @@ static const struct rt2x00_ops rt2800soc_ops = {
 
 static int rt2800soc_probe(struct platform_device *pdev)
 {
-	return rt2x00soc_probe(pdev, &rt2800soc_ops);
+	const struct rt2x00_ops *ops = of_device_get_match_data(&pdev->dev);
+	struct rt2x00_dev *rt2x00dev;
+	struct ieee80211_hw *hw;
+	void __iomem *mem;
+	struct clk *clk;
+	int retval;
+	int irq;
+
+	mem = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(mem))
+		return PTR_ERR(mem);
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
+
+	clk = devm_clk_get_optional(&pdev->dev, NULL);
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
+
+	hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw);
+	if (!hw)
+		return dev_err_probe(&pdev->dev, -ENOMEM, "Failed to allocate hardware");
+
+	platform_set_drvdata(pdev, hw);
+
+	rt2x00dev = hw->priv;
+	rt2x00dev->dev = &pdev->dev;
+	rt2x00dev->ops = ops;
+	rt2x00dev->hw = hw;
+	rt2x00dev->irq = irq;
+	rt2x00dev->clk = clk;
+	rt2x00dev->name = pdev->dev.driver->name;
+	rt2x00dev->csr.base = mem;
+
+	rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC);
+
+	rt2x00dev->eeprom = devm_kzalloc(&pdev->dev, rt2x00dev->ops->eeprom_size, GFP_KERNEL);
+	if (!rt2x00dev->eeprom) {
+		retval = -ENOMEM;
+		goto exit_free_device;
+	}
+
+	rt2x00dev->rf = devm_kzalloc(&pdev->dev, rt2x00dev->ops->rf_size, GFP_KERNEL);
+	if (!rt2x00dev->rf) {
+		retval = -ENOMEM;
+		goto exit_free_device;
+	}
+
+	retval = rt2x00lib_probe_dev(rt2x00dev);
+	if (retval)
+		goto exit_free_device;
+
+	return 0;
+
+exit_free_device:
+	ieee80211_free_hw(hw);
+
+	return retval;
+}
+
+static void rt2800soc_remove(struct platform_device *pdev)
+{
+	struct ieee80211_hw *hw = platform_get_drvdata(pdev);
+	struct rt2x00_dev *rt2x00dev = hw->priv;
+
+	/*
+	 * Free all allocated data.
+	 */
+	rt2x00lib_remove_dev(rt2x00dev);
+	ieee80211_free_hw(hw);
 }
 
 static const struct of_device_id rt2880_wmac_match[] = {
@@ -372,7 +343,7 @@ static struct platform_driver rt2800soc_driver = {
 		.of_match_table = rt2880_wmac_match,
 	},
 	.probe		= rt2800soc_probe,
-	.remove		= rt2x00soc_remove,
+	.remove		= rt2800soc_remove,
 	.suspend	= rt2x00soc_suspend,
 	.resume		= rt2x00soc_resume,
 };
Signature · 1 line
2.50.0
#8 lore raw

PATCH v2 6/7 MIPS: dts: ralink: mt7620a: add wifi

In reply to Rosen Penev

MT7620A devices all contain a wifi device as part of the SOC. Add it here to get it working.

---
 arch/mips/boot/dts/ralink/mt7620a.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/mips/boot/dts/ralink/mt7620a.dtsi +10 -0
index d66045948a83..460164bdd430 100644
@@ -62,4 +62,14 @@ uartlite@c00 {
 			reg-shift = <2>;
 		};
 	};
+
+	wmac: wifi@10180000 {
+		compatible = "ralink,rt2880-wifi";
+		reg = <0x10180000 0x40000>;
+
+		clocks = <&sysc 16>;
+
+		interrupt-parent = <&cpuintc>;
+		interrupts = <6>;
+	};
 };
Signature · 1 line
2.50.0
#9 lore raw

PATCH v2 7/7 dt-bindings: net: wireless: rt2800: add

In reply to Rosen Penev

Add device-tree bindings for the RT2800 SOC wifi device found in older Ralink/Mediatek devices.

---
 .../bindings/net/wireless/ralink,rt2800.yaml  | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ralink,rt2800.yaml
Documentation/devicetree/bindings/net/wireless/ralink,rt2800.yaml new file +47 -0
new file mode 100644
index 000000000000..0c374cd5adb8
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/wireless/ralink,rt2800.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ralink RT2800 wireless devices
+
+maintainers:
+  - Stanislaw Gruszka <[email protected]>
+
+description: |
+  This node provides properties for configuring RT2800 SOC wifi device.
+  The node is expected to be specified as a root node of the device.
+
+allOf:
+  - $ref: ieee80211.yaml#
+
+properties:
+  compatible:
+    enum:
+      - ralink,rt2800-wifi
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    wifi@110180000 {
+      compatible = "ralink,rt2880-wifi";
+      reg = <0x10180000 0x40000>;
+      clocks = <&sysc 16>;
+      interrupt-parent = <&cpuintc>;
+      interrupts = <6>;
+    };
Signature · 1 line
2.50.0
#10 lore raw

Re: [PATCHv2 wireless-next 7/7] dt-bindings: net: wireless: rt2800: add

Quoted 9 lines · Rosen Penev

Add device-tree bindings for the RT2800 SOC wifi device found in older Ralink/Mediatek devices.

---
 .../bindings/net/wireless/ralink,rt2800.yaml  | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ralink,rt2800.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/net/wireless/ralink,rt2800.example.dtb: /example-0/wifi@110180000: failed to match any schema with compatible: ['ralink,rt2880-wifi']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#11 lore raw

Re: [PATCHv2 wireless-next 7/7] dt-bindings: net: wireless: rt2800: add

Quoted 13 lines · Rob Herring (Arm)
Quoted 9 lines · Rosen Penev

Add device-tree bindings for the RT2800 SOC wifi device found in older Ralink/Mediatek devices.

---
 .../bindings/net/wireless/ralink,rt2800.yaml  | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ralink,rt2800.yaml
Quoted 6 lines

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/net/wireless/ralink,rt2800.example.dtb: /example-0/wifi@110180000: failed to match any schema with compatible: ['ralink,rt2880-wifi']

ralink,rt2880-wifi vs ralink,rt2800-wifi

lovely...

Quoted 18 lines

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#5 lore raw

Re: [PATCHv2 wireless-next 4/7] wifi: rt2800: move 2x00soc to 2800soc

In reply to Rosen Penev
kernel test robot noticed the following build errors:

Hi Rosen,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless/main]
[also build test ERROR on next-20250708]
[cannot apply to wireless-next/main robh/for-next linus/master v6.16-rc5] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Rosen-Penev/wifi-rt2x00-add-COMPILE_TEST/20250709-042051
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git main
patch link:    https://lore.kernel.org/r/20250708201745.5900-5-rosenp%40gmail.com
patch subject: [PATCHv2 wireless-next 4/7] wifi: rt2800: move 2x00soc to 2800soc
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20250709/[email protected]/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250709/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/net/wireless/ralink/rt2x00/rt2800soc.c:376:27: error: 'rt2x00soc_suspend' undeclared here (not in a function); did you mean 'rt2x00lib_suspend'?
     376 |         .suspend        = rt2x00soc_suspend,
         |                           ^~~~~~~~~~~~~~~~~
         |                           rt2x00lib_suspend
>> drivers/net/wireless/ralink/rt2x00/rt2800soc.c:377:27: error: 'rt2x00soc_resume' undeclared here (not in a function); did you mean 'rt2x00soc_remove'?
     377 |         .resume         = rt2x00soc_resume,
         |                           ^~~~~~~~~~~~~~~~
         |                           rt2x00soc_remove

vim +376 drivers/net/wireless/ralink/rt2x00/rt2800soc.c

90ce325a735fa7 drivers/net/wireless/ralink/rt2x00/rt2800soc.c Rosen Penev 2025-07-08  368  
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  369  static struct platform_driver rt2800soc_driver = {
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  370  	.driver		= {
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  371  		.name		= "rt2800_wmac",
90ce325a735fa7 drivers/net/wireless/ralink/rt2x00/rt2800soc.c Rosen Penev 2025-07-08  372  		.of_match_table = rt2880_wmac_match,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  373  	},
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  374  	.probe		= rt2800soc_probe,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  375  	.remove		= rt2x00soc_remove,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17 @376  	.suspend	= rt2x00soc_suspend,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17 @377  	.resume		= rt2x00soc_resume,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  378  };
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  379  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#7 lore raw

Re: [PATCHv2 wireless-next 5/7] wifi: rt2x00: soc: modernize probe

In reply to Rosen Penev
kernel test robot noticed the following build errors:

Hi Rosen,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless/main]
[also build test ERROR on next-20250709]
[cannot apply to wireless-next/main robh/for-next linus/master v6.16-rc5] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Rosen-Penev/wifi-rt2x00-add-COMPILE_TEST/20250709-042051
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git main
patch link:    https://lore.kernel.org/r/20250708201745.5900-6-rosenp%40gmail.com
patch subject: [PATCHv2 wireless-next 5/7] wifi: rt2x00: soc: modernize probe
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20250709/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250709/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/net/wireless/ralink/rt2x00/rt2800soc.c:347:13: error: use of undeclared identifier 'rt2x00soc_suspend'; did you mean 'rt2x00lib_suspend'?

     347 |         .suspend        = rt2x00soc_suspend,
         |                           ^~~~~~~~~~~~~~~~~
         |                           rt2x00lib_suspend
   drivers/net/wireless/ralink/rt2x00/rt2x00.h:1504:5: note: 'rt2x00lib_suspend' declared here
    1504 | int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev);
         |     ^
   drivers/net/wireless/ralink/rt2x00/rt2800soc.c:348:13: error: use of undeclared identifier 'rt2x00soc_resume'; did you mean 'rt2x00lib_resume'?
     348 |         .resume         = rt2x00soc_resume,
         |                           ^~~~~~~~~~~~~~~~
         |                           rt2x00lib_resume
   drivers/net/wireless/ralink/rt2x00/rt2x00.h:1505:5: note: 'rt2x00lib_resume' declared here
    1505 | int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev);
         |     ^
>> drivers/net/wireless/ralink/rt2x00/rt2800soc.c:347:13: error: incompatible function pointer types initializing 'int (*)(struct platform_device *, pm_message_t)' (aka 'int (*)(struct platform_device *, struct pm_message)') with an expression of type 'int (struct rt2x00_dev *)' [-Wincompatible-function-pointer-types]
     347 |         .suspend        = rt2x00soc_suspend,
         |                           ^~~~~~~~~~~~~~~~~
>> drivers/net/wireless/ralink/rt2x00/rt2800soc.c:348:13: error: incompatible function pointer types initializing 'int (*)(struct platform_device *)' with an expression of type 'int (struct rt2x00_dev *)' [-Wincompatible-function-pointer-types]

348 | .resume = rt2x00soc_resume,
| ^~~~~~~~~~~~~~~~
4 errors generated.

vim +347 drivers/net/wireless/ralink/rt2x00/rt2800soc.c

90ce325a735fa7 drivers/net/wireless/ralink/rt2x00/rt2800soc.c Rosen Penev 2025-07-08  339  
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  340  static struct platform_driver rt2800soc_driver = {
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  341  	.driver		= {
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  342  		.name		= "rt2800_wmac",
90ce325a735fa7 drivers/net/wireless/ralink/rt2x00/rt2800soc.c Rosen Penev 2025-07-08  343  		.of_match_table = rt2880_wmac_match,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  344  	},
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  345  	.probe		= rt2800soc_probe,
115321558169cc drivers/net/wireless/ralink/rt2x00/rt2800soc.c Rosen Penev 2025-07-08  346  	.remove		= rt2800soc_remove,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17 @347  	.suspend	= rt2x00soc_suspend,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17 @348  	.resume		= rt2x00soc_resume,
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  349  };
fe7ef7c60c33fd drivers/net/wireless/rt2x00/rt2800soc.c        Gabor Juhos 2013-10-17  350  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki