[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zl0kqbWp1SJYjzO6@colin-ia-desktop>
Date: Sun, 2 Jun 2024 21:04:25 -0500
From: Colin Foster <colin.foster@...advantage.com>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
UNGLinuxDriver@...rochip.com, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Russell King <linux@...linux.org.uk>
Subject: Re: [PATCH net-next 7/8] net: dsa: ocelot: common probing code
On Thu, May 30, 2024 at 07:33:32PM +0300, Vladimir Oltean wrote:
> Russell King suggested that felix_vsc9959, seville_vsc9953 and
> ocelot_ext have a large portion of duplicated init code, which could be
> made common [1].
>
> [1]: https://lore.kernel.org/all/Zh1GvcOTXqb7CpQt@shell.armlinux.org.uk/
>
> Here, we take the following common steps:
> - "felix" and "ds" structure allocation
> - "felix", "ocelot" and "ds" basic structure initialization
> - dsa_register_switch() call
>
> and we make a common function out of them.
>
> For every driver except felix_vsc9959, this is also the entire probing
> procedure. For felix_vsc9959, we also need to do some PCI-specific
> stuff, which can easily be reordered to be done before, and unwound on
> failure.
>
> We also have to convert the bus-specific platform_set_drvdata() and
> pci_set_drvdata() calls into dev_set_drvdata(). But this should have no
> impact on the behavior.
>
> Suggested-by: "Russell King (Oracle)" <linux@...linux.org.uk>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> ---
> drivers/net/dsa/ocelot/felix.c | 47 ++++++++++++++++++++++++
> drivers/net/dsa/ocelot/felix.h | 5 +++
> drivers/net/dsa/ocelot/felix_vsc9959.c | 44 +++-------------------
> drivers/net/dsa/ocelot/ocelot_ext.c | 40 +-------------------
> drivers/net/dsa/ocelot/seville_vsc9953.c | 38 ++-----------------
Tested-by: Colin Foster <colin.foster@...advantage.com>
Powered by blists - more mailing lists