mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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:
parent
05f294a852
commit
7e99e34701
14 changed files with 49 additions and 28 deletions
|
@ -286,10 +286,13 @@ static int dsa_loop_drv_probe(struct mdio_device *mdiodev)
|
|||
dev_info(&mdiodev->dev, "%s: 0x%0x\n",
|
||||
pdata->name, pdata->enabled_ports);
|
||||
|
||||
ds = dsa_switch_alloc(&mdiodev->dev, DSA_MAX_PORTS);
|
||||
ds = devm_kzalloc(&mdiodev->dev, sizeof(*ds), GFP_KERNEL);
|
||||
if (!ds)
|
||||
return -ENOMEM;
|
||||
|
||||
ds->dev = &mdiodev->dev;
|
||||
ds->num_ports = DSA_MAX_PORTS;
|
||||
|
||||
ps = devm_kzalloc(&mdiodev->dev, sizeof(*ps), GFP_KERNEL);
|
||||
if (!ps)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue