Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbb8d793 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

net: dsa: Pass the dsa device to the switch drivers



By passing a device structure to the switch devices, it allows them
to use devm_* methods for resource management.

Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Tested-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 71bbe25d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -135,7 +135,8 @@ 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)
{
	return "Broadcom Starfighter 2";
}
+2 −1
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val)
			return __ret;				\
	})

static char *mv88e6060_probe(struct device *host_dev, int sw_addr)
static char *mv88e6060_probe(struct device *dsa_dev, struct device *host_dev,
			     int sw_addr)
{
	struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
	int ret;
+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ static const struct mv88e6xxx_switch_id mv88e6123_table[] = {
	{ PORT_SWITCH_ID_6165_A2, "Marvell 88e6165 (A2)" },
};

static char *mv88e6123_probe(struct device *host_dev, int sw_addr)
static char *mv88e6123_probe(struct device *dsa_dev, struct device *host_dev,
			     int sw_addr)
{
	return mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6123_table,
				     ARRAY_SIZE(mv88e6123_table));
+2 −1
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@ static const struct mv88e6xxx_switch_id mv88e6131_table[] = {
	{ PORT_SWITCH_ID_6185, "Marvell 88E6185" },
};

static char *mv88e6131_probe(struct device *host_dev, int sw_addr)
static char *mv88e6131_probe(struct device *dsa_dev, struct device *host_dev,
			     int sw_addr)
{
	return mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6131_table,
				     ARRAY_SIZE(mv88e6131_table));
+2 −1
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ static const struct mv88e6xxx_switch_id mv88e6171_table[] = {
	{ PORT_SWITCH_ID_6351, "Marvell 88E6351" },
};

static char *mv88e6171_probe(struct device *host_dev, int sw_addr)
static char *mv88e6171_probe(struct device *dsa_dev, struct device *host_dev,
			     int sw_addr)
{
	return mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6171_table,
				     ARRAY_SIZE(mv88e6171_table));
Loading