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
@@ -2047,10 +2047,12 @@ static int sja1105_probe(struct spi_device *spi)
|
||||
|
||||
dev_info(dev, "Probed switch chip: %s\n", priv->info->name);
|
||||
|
||||
ds = dsa_switch_alloc(dev, SJA1105_NUM_PORTS);
|
||||
ds = devm_kzalloc(dev, sizeof(*ds), GFP_KERNEL);
|
||||
if (!ds)
|
||||
return -ENOMEM;
|
||||
|
||||
ds->dev = dev;
|
||||
ds->num_ports = SJA1105_NUM_PORTS;
|
||||
ds->ops = &sja1105_switch_ops;
|
||||
ds->priv = priv;
|
||||
priv->ds = ds;
|
||||
|
Reference in New Issue
Block a user