net: dsa: remove dsa_switch_alloc helper
Now that ports are dynamically listed in the fabric, there is no need to provide a special helper to allocate the dsa_switch structure. This will give more flexibility to drivers to embed this structure as they wish in their private structure. Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
This commit is contained in:

committed by
Jakub Kicinski

parent
05f294a852
commit
7e99e34701
@@ -1632,10 +1632,13 @@ mt7530_probe(struct mdio_device *mdiodev)
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->ds = dsa_switch_alloc(&mdiodev->dev, DSA_MAX_PORTS);
|
||||
priv->ds = devm_kzalloc(&mdiodev->dev, sizeof(*priv->ds), GFP_KERNEL);
|
||||
if (!priv->ds)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->ds->dev = &mdiodev->dev;
|
||||
priv->ds->num_ports = DSA_MAX_PORTS;
|
||||
|
||||
/* Use medatek,mcm property to distinguish hardware type that would
|
||||
* casues a little bit differences on power-on sequence.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user