net: dsa: remove dsa_switch_alloc helper
[linux-2.6-microblaze.git] / drivers / net / dsa / lan9303-core.c
index bbec86b..e3c333a 100644 (file)
@@ -1283,10 +1283,12 @@ static int lan9303_register_switch(struct lan9303 *chip)
 {
        int base;
 
-       chip->ds = dsa_switch_alloc(chip->dev, LAN9303_NUM_PORTS);
+       chip->ds = devm_kzalloc(chip->dev, sizeof(*chip->ds), GFP_KERNEL);
        if (!chip->ds)
                return -ENOMEM;
 
+       chip->ds->dev = chip->dev;
+       chip->ds->num_ports = LAN9303_NUM_PORTS;
        chip->ds->priv = chip;
        chip->ds->ops = &lan9303_switch_ops;
        base = chip->phy_addr_base;