summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/realtek-smi-core.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@gmail.com>2019-10-21 16:51:30 -0400
committerJakub Kicinski <jakub.kicinski@netronome.com>2019-10-22 12:37:07 -0700
commit7e99e34701728d54ccd0466eccf377a42b9db215 (patch)
tree9047ed67e960bddc994b2bf7a4ecbb8fa0c8ca16 /drivers/net/dsa/realtek-smi-core.c
parent05f294a852358a46d9236cc777901f49a4f0ae85 (diff)
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>
Diffstat (limited to 'drivers/net/dsa/realtek-smi-core.c')
-rw-r--r--drivers/net/dsa/realtek-smi-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/dsa/realtek-smi-core.c b/drivers/net/dsa/realtek-smi-core.c
index dc0509c02d29..fae188c60191 100644
--- a/drivers/net/dsa/realtek-smi-core.c
+++ b/drivers/net/dsa/realtek-smi-core.c
@@ -444,9 +444,12 @@ static int realtek_smi_probe(struct platform_device *pdev)
return ret;
}
- smi->ds = dsa_switch_alloc(dev, smi->num_ports);
+ smi->ds = devm_kzalloc(dev, sizeof(*smi->ds), GFP_KERNEL);
if (!smi->ds)
return -ENOMEM;
+
+ smi->ds->dev = dev;
+ smi->ds->num_ports = smi->num_ports;
smi->ds->priv = smi;
smi->ds->ops = var->ds_ops;