net: dsa: remove name arg from slave create
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Fri, 27 Oct 2017 19:55:19 +0000 (15:55 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Nov 2017 02:47:36 +0000 (11:47 +0900)
Now that slave dsa_port always have their name set, there is no need to
pass it to dsa_slave_create() anymore. Remove this argument.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa2.c
net/dsa/dsa_priv.h
net/dsa/legacy.c
net/dsa/slave.c

index 3c134ff26863f56e7515b0fb9705fa236bbd1ff6..797d1156b4e658727de5766ce02e416a5ae8d6b9 100644 (file)
@@ -257,10 +257,9 @@ static void dsa_cpu_port_unapply(struct dsa_port *port)
 static int dsa_user_port_apply(struct dsa_port *port)
 {
        struct dsa_switch *ds = port->ds;
-       const char *name = port->name;
        int err;
 
-       err = dsa_slave_create(port, name);
+       err = dsa_slave_create(port);
        if (err) {
                dev_warn(ds->dev, "Failed to create slave %d: %d\n",
                         port->index, err);
index 1e65afd6989ecaf1a414594d7af428698b8a7141..253a613c40cda83f902fb4b2eb2df1c33ed4f0f5 100644 (file)
@@ -163,7 +163,7 @@ void dsa_port_fixed_link_unregister_of(struct dsa_port *dp);
 /* slave.c */
 extern const struct dsa_device_ops notag_netdev_ops;
 void dsa_slave_mii_bus_init(struct dsa_switch *ds);
-int dsa_slave_create(struct dsa_port *port, const char *name);
+int dsa_slave_create(struct dsa_port *dp);
 void dsa_slave_destroy(struct net_device *slave_dev);
 int dsa_slave_suspend(struct net_device *slave_dev);
 int dsa_slave_resume(struct net_device *slave_dev);
index afe6e1539bd0c9675c006cde332c0a61d4642533..0511fe2feff7cbf5d1f36e4f0047f4c67f66c978 100644 (file)
@@ -197,7 +197,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds,
                if (dsa_is_user_port(ds, i))
                        continue;
 
-               ret = dsa_slave_create(&ds->ports[i], cd->port_names[i]);
+               ret = dsa_slave_create(&ds->ports[i]);
                if (ret < 0)
                        netdev_err(master, "[%d]: can't create dsa slave device for port %d(%s): %d\n",
                                   index, i, cd->port_names[i], ret);
index 808e205227c38ca7a7f50fc4a046184fa93a0e55..48b954a76b0d9bafa1e115fd09f5d4418acfc68e 100644 (file)
@@ -1142,11 +1142,12 @@ static void dsa_slave_notify(struct net_device *dev, unsigned long val)
        call_dsa_notifiers(val, dev, &rinfo.info);
 }
 
-int dsa_slave_create(struct dsa_port *port, const char *name)
+int dsa_slave_create(struct dsa_port *port)
 {
        struct dsa_port *cpu_dp = port->cpu_dp;
        struct net_device *master = cpu_dp->master;
        struct dsa_switch *ds = port->ds;
+       const char *name = port->name;
        struct net_device *slave_dev;
        struct dsa_slave_priv *p;
        int ret;