Re: [RFC net-next 2/2] net: dsa: Add driver for Maxlinear GSW1XX switch

From: Krzysztof Kozlowski
Date: Thu Oct 27 2022 - 08:48:50 EST


On 27/10/2022 02:35, Camel Guo wrote:
utdown(priv->ds);
> >> +
> >> +     dev_set_drvdata(priv->dev, NULL);
> >> +}
> >> +EXPORT_SYMBOL(gsw1xx_shutdown);
> >
> > 1. EXPORT_SYMBOL_GPL
>
> Will update in v2
>
> > 2. Why do you do it in the first place? It's one driver, no need for
> > building two modules. Same applies to other places.
>
> All stuff in drivers/net/dsa/gsw1xx_core.c is supposed to be generic and
> totally independent of the actual management interface (mdio, spi, uart,
> maybe memory-mapped IO). This way, I think the gsw1xx_core.ko can be
> reused in
> gsw1xx_spi.ko, gsw1xx_uart.ko and so on.
>
> I don't how similar the chips that lantiq_gswip.c supports are due to
> no datasheet. If not too much, maybe someone the gsw1xx_core.ko can also
> be reused in lantiq_gswip as well.

Keep the files separate but there is no need to make two modules and
exprt this. Your patch should stand on its own, not prepare for some
imaginary future work which might or might not bring more modules.

Once these future modules appear, it will be easy to change existing
file to a module.

Best regards,
Krzysztof