Re: [PATCH net-next 14/15] net: sparx5: add compatible strings for lan969x and verify the target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux