Skip to content

Commit

Permalink
net: dsa: remove trans argument from mdb ops
Browse files Browse the repository at this point in the history
The DSA switch MDB ops pass the switchdev_trans structure down to the
drivers, but no one is using them and they aren't supposed to anyway.

Remove the trans argument from MDB prepare and add operations.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vivien Didelot authored and David S. Miller committed Dec 3, 2017
1 parent 80e0236 commit 3709aad
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
6 changes: 2 additions & 4 deletions drivers/net/dsa/lan9303-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,8 +1217,7 @@ static int lan9303_port_fdb_dump(struct dsa_switch *ds, int port,
}

static int lan9303_port_mdb_prepare(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans)
const struct switchdev_obj_port_mdb *mdb)
{
struct lan9303 *chip = ds->priv;

Expand All @@ -1235,8 +1234,7 @@ static int lan9303_port_mdb_prepare(struct dsa_switch *ds, int port,
}

static void lan9303_port_mdb_add(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans)
const struct switchdev_obj_port_mdb *mdb)
{
struct lan9303 *chip = ds->priv;

Expand Down
6 changes: 2 additions & 4 deletions drivers/net/dsa/microchip/ksz_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,16 +856,14 @@ static int ksz_port_fdb_dump(struct dsa_switch *ds, int port,
}

static int ksz_port_mdb_prepare(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans)
const struct switchdev_obj_port_mdb *mdb)
{
/* nothing to do */
return 0;
}

static void ksz_port_mdb_add(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans)
const struct switchdev_obj_port_mdb *mdb)
{
struct ksz_device *dev = ds->priv;
u32 static_table[4];
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -3786,8 +3786,7 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
}

static int mv88e6xxx_port_mdb_prepare(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans)
const struct switchdev_obj_port_mdb *mdb)
{
/* We don't need any dynamic resource from the kernel (yet),
* so skip the prepare phase.
Expand All @@ -3797,8 +3796,7 @@ static int mv88e6xxx_port_mdb_prepare(struct dsa_switch *ds, int port,
}

static void mv88e6xxx_port_mdb_add(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans)
const struct switchdev_obj_port_mdb *mdb)
{
struct mv88e6xxx_chip *chip = ds->priv;

Expand Down
10 changes: 4 additions & 6 deletions include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,10 @@ struct dsa_switch_ops {
/*
* Multicast database
*/
int (*port_mdb_prepare)(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans);
void (*port_mdb_add)(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans);
int (*port_mdb_prepare)(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb);
void (*port_mdb_add)(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb);
int (*port_mdb_del)(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb);
/*
Expand Down
4 changes: 2 additions & 2 deletions net/dsa/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int dsa_switch_mdb_add(struct dsa_switch *ds,
return -EOPNOTSUPP;

for_each_set_bit(port, group, ds->num_ports) {
err = ds->ops->port_mdb_prepare(ds, port, mdb, trans);
err = ds->ops->port_mdb_prepare(ds, port, mdb);
if (err)
return err;
}
Expand All @@ -138,7 +138,7 @@ static int dsa_switch_mdb_add(struct dsa_switch *ds,
}

for_each_set_bit(port, group, ds->num_ports)
ds->ops->port_mdb_add(ds, port, mdb, trans);
ds->ops->port_mdb_add(ds, port, mdb);

return 0;
}
Expand Down

0 comments on commit 3709aad

Please sign in to comment.