aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/dsa_loop.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/dsa_loop.c
parentnet: dsa: allocate ports on touch (diff)
downloadlinux-dev-7e99e34701728d54ccd0466eccf377a42b9db215.tar.xz
linux-dev-7e99e34701728d54ccd0466eccf377a42b9db215.zip
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/dsa_loop.c')
-rw-r--r--drivers/net/dsa/dsa_loop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index 925ed135a4d9..c8d7ef27fd72 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -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;