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

Rosen Penev rosenp at gmail.com
Sat Jul 12 12:02:35 PDT 2025


On Sat, Jul 12, 2025 at 3:14 AM Stanislaw Gruszka <stf_xl at wp.pl> wrote:
>
> On Thu, Jul 10, 2025 at 01:08:16PM -0700, Rosen Penev wrote:
> > 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 <rosenp at gmail.com>
> > Reviewed-by: Sergio Paracuellos <sergio.paracuellos at 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.
>
> Regards
> Stanislaw
>
> > +     {},
> > +};
> > +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,
> > --
> > 2.50.0
> >



More information about the Linux-mediatek mailing list