[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241022083212.mvugftw2xpoynje2@DEN-DL-M70577>
Date: Tue, 22 Oct 2024 08:32:12 +0000
From: Daniel Machon <daniel.machon@...rochip.com>
To: Krzysztof Kozlowski <krzk@...nel.org>
CC: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, <andrew@...n.ch>, Lars Povlsen
<lars.povlsen@...rochip.com>, Steen Hegelund <Steen.Hegelund@...rochip.com>,
<horatiu.vultur@...rochip.com>, <jensemil.schulzostergaard@...rochip.com>,
<Parthiban.Veerasooran@...rochip.com>, <Raju.Lakkaraju@...rochip.com>,
<UNGLinuxDriver@...rochip.com>, Richard Cochran <richardcochran@...il.com>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, <jacob.e.keller@...el.com>,
<ast@...erby.net>, <maxime.chevallier@...tlin.com>, <netdev@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>
Subject: Re: [PATCH net-next 14/15] net: sparx5: add compatible strings for
lan969x and verify the target
Hi Krzysztof,
> On Mon, Oct 21, 2024 at 03:58:51PM +0200, Daniel Machon wrote:
> > @@ -227,6 +229,168 @@ bool is_sparx5(struct sparx5 *sparx5)
> > }
> > }
> >
> > +/* Set the devicetree target based on the compatible string */
> > +static int sparx5_set_target_dt(struct sparx5 *sparx5)
> > +{
> > + struct device_node *node = sparx5->pdev->dev.of_node;
> > +
> > + if (is_sparx5(sparx5))
> > + /* For Sparx5 the devicetree target is always the chip target */
> > + sparx5->target_dt = sparx5->target_ct;
> > + else if (of_device_is_compatible(node, "microchip,lan9691-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9691VAO;
> > + else if (of_device_is_compatible(node, "microchip,lan9692-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9692VAO;
> > + else if (of_device_is_compatible(node, "microchip,lan9693-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9693VAO;
> > + else if (of_device_is_compatible(node, "microchip,lan9694-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9694;
> > + else if (of_device_is_compatible(node, "microchip,lan9695-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9694TSN;
> > + else if (of_device_is_compatible(node, "microchip,lan9696-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9696;
> > + else if (of_device_is_compatible(node, "microchip,lan9697-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9696TSN;
> > + else if (of_device_is_compatible(node, "microchip,lan9698-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9698;
> > + else if (of_device_is_compatible(node, "microchip,lan9699-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9698TSN;
> > + else if (of_device_is_compatible(node, "microchip,lan969a-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9694RED;
> > + else if (of_device_is_compatible(node, "microchip,lan969b-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9696RED;
> > + else if (of_device_is_compatible(node, "microchip,lan969c-switch"))
> > + sparx5->target_dt = SPX5_TARGET_CT_LAN9698RED;
>
> Do not re-implement match data.
>
> >
Thank you for your feedback.
I will get rid of this function and instread create match data structs
for each SKU.
/Daniel
Powered by blists - more mailing lists