net: dsa: Have the switch driver allocate there own private memory
[deliverable/linux.git] / drivers / net / dsa / bcm_sf2.c
index 780f228765388c196398fd5f7aef6bb2ca5cd754..7d62802a66d591884f4381d06bfb9ca9aff302d7 100644 (file)
@@ -135,8 +135,16 @@ 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_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";
 }
 
@@ -1362,7 +1370,6 @@ 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,
        .setup                  = bcm_sf2_sw_setup,
        .set_addr               = bcm_sf2_sw_set_addr,
This page took 0.038952 seconds and 5 git commands to generate.