net: mscc: ocelot: initialize list of multicast addresses in common code
authorClaudiu Manoil <claudiu.manoil@nxp.com>
Sat, 9 Nov 2019 13:02:58 +0000 (15:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Nov 2019 20:59:10 +0000 (12:59 -0800)
This is just common path code that belongs to ocelot_init,
it has nothing to do with a specific SoC/board instance.

Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/mscc/ocelot_board.c

index df8796f05ff93a9f981ef8a68d22bd1d732b0165..4cb78e14f2fd624bd155137a64dd5faeef1c0d57 100644 (file)
@@ -2243,6 +2243,7 @@ int ocelot_init(struct ocelot *ocelot)
        if (!ocelot->stats_queue)
                return -ENOMEM;
 
+       INIT_LIST_HEAD(&ocelot->multicast);
        ocelot_mact_init(ocelot);
        ocelot_vlan_init(ocelot);
        ocelot_ace_init(ocelot);
index 4793d275d8459358e3c84a77005ab7f02834ce3e..9985fb334aac96e7b28e6b460940ba05cac3c0b9 100644 (file)
@@ -364,7 +364,6 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
        ocelot->ports = devm_kcalloc(&pdev->dev, ocelot->num_phys_ports,
                                     sizeof(struct ocelot_port *), GFP_KERNEL);
 
-       INIT_LIST_HEAD(&ocelot->multicast);
        ocelot_init(ocelot);
 
        for_each_available_child_of_node(ports, portnp) {