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>
此提交包含在:
@@ -4978,10 +4978,12 @@ static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
|
||||
struct device *dev = chip->dev;
|
||||
struct dsa_switch *ds;
|
||||
|
||||
ds = dsa_switch_alloc(dev, mv88e6xxx_num_ports(chip));
|
||||
ds = devm_kzalloc(dev, sizeof(*ds), GFP_KERNEL);
|
||||
if (!ds)
|
||||
return -ENOMEM;
|
||||
|
||||
ds->dev = dev;
|
||||
ds->num_ports = mv88e6xxx_num_ports(chip);
|
||||
ds->priv = chip;
|
||||
ds->dev = dev;
|
||||
ds->ops = &mv88e6xxx_switch_ops;
|
||||
|
新增問題並參考
封鎖使用者