Thread (25 messages) 25 messages, 6 authors, 2025-07-13

Re: [PATCHv3 wireless-next 3/7] wifi: rt2800soc: allow loading from OF

From: Stanislaw Gruszka <stf_xl@wp.pl>
Date: 2025-07-13 07:15:35
Also in: linux-devicetree, linux-mediatek, linux-mips, linux-wireless, lkml

On Sat, Jul 12, 2025 at 12:02:35PM -0700, Rosen Penev wrote:
On Sat, Jul 12, 2025 at 3:14 AM Stanislaw Gruszka [off-list ref] wrote:
quoted
On Thu, Jul 10, 2025 at 01:08:16PM -0700, Rosen Penev wrote:
quoted
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.

Added OF dependency to SOC CONFIG as adding of_match_table without OF
being present makes no sense.

Signed-off-by: Rosen Penev <redacted>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/net/wireless/ralink/rt2x00/Kconfig     | 2 +-
 drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/Kconfig b/drivers/net/wireless/ralink/rt2x00/Kconfig
index 3a32ceead54f..a0dc9a751234 100644
--- a/drivers/net/wireless/ralink/rt2x00/Kconfig
+++ b/drivers/net/wireless/ralink/rt2x00/Kconfig
@@ -202,7 +202,7 @@ endif

 config RT2800SOC
      tristate "Ralink WiSoC support"
-     depends on SOC_RT288X || SOC_RT305X || SOC_MT7620 || COMPILE_TEST
+     depends on OF && (SOC_RT288X || SOC_RT305X || SOC_MT7620 || COMPILE_TEST)
      select RT2X00_LIB_SOC
      select RT2X00_LIB_MMIO
      select RT2X00_LIB_CRYPTO
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
index e73394cf6ea6..db8d01f0cdc3 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
@@ -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 },
Why do .data = rt2800soc_ops here and use it via of_device_get_match_data()
in patch 5, insead of just use rt2800soc_ops directly in rt2800soc_probe ?
I see more of the former instead of the latter in drivers.
If there is no technical reason to use indirection, this can be
simplified as well. Can be done as separate patch since you already
posed v4.

Regards
Stanislaw

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help