net: dsa: Rename DSA probe function.
[deliverable/linux.git] / drivers / net / dsa / bcm_sf2.c
index 2bba1d93869476230a298ff628df80b739794dd4..50caa525cda37f21fc51ecf5747f032fb76bfedb 100644 (file)
@@ -135,8 +135,17 @@ static int bcm_sf2_sw_get_sset_count(struct dsa_switch *ds)
        return BCM_SF2_STATS_SIZE;
 }
 
-static char *bcm_sf2_sw_probe(struct device *host_dev, int sw_addr)
+static char *bcm_sf2_sw_drv_probe(struct device *dsa_dev,
+                                 struct device *host_dev,
+                                 int sw_addr, void **_priv)
 {
+       struct bcm_sf2_priv *priv;
+
+       priv = devm_kzalloc(dsa_dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return NULL;
+       *_priv = priv;
+
        return "Broadcom Starfighter 2";
 }
 
@@ -724,13 +733,14 @@ static int bcm_sf2_sw_fdb_prepare(struct dsa_switch *ds, int port,
        return 0;
 }
 
-static int bcm_sf2_sw_fdb_add(struct dsa_switch *ds, int port,
-                             const struct switchdev_obj_port_fdb *fdb,
-                             struct switchdev_trans *trans)
+static void bcm_sf2_sw_fdb_add(struct dsa_switch *ds, int port,
+                              const struct switchdev_obj_port_fdb *fdb,
+                              struct switchdev_trans *trans)
 {
        struct bcm_sf2_priv *priv = ds_to_priv(ds);
 
-       return bcm_sf2_arl_op(priv, 0, port, fdb->addr, fdb->vid, true);
+       if (bcm_sf2_arl_op(priv, 0, port, fdb->addr, fdb->vid, true))
+               pr_err("%s: failed to add MAC address\n", __func__);
 }
 
 static int bcm_sf2_sw_fdb_del(struct dsa_switch *ds, int port,
@@ -1361,8 +1371,7 @@ static int bcm_sf2_sw_set_wol(struct dsa_switch *ds, int port,
 
 static struct dsa_switch_driver bcm_sf2_switch_driver = {
        .tag_protocol           = DSA_TAG_PROTO_BRCM,
-       .priv_size              = sizeof(struct bcm_sf2_priv),
-       .probe                  = bcm_sf2_sw_probe,
+       .probe                  = bcm_sf2_sw_drv_probe,
        .setup                  = bcm_sf2_sw_setup,
        .set_addr               = bcm_sf2_sw_set_addr,
        .get_phy_flags          = bcm_sf2_sw_get_phy_flags,
This page took 0.030387 seconds and 5 git commands to generate.