diff options
author | Andrew Lunn <andrew@lunn.ch> | 2016-04-28 21:24:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-02 00:16:23 -0400 |
commit | 158bc065f29c9be0919d18aefab320161936b3a8 (patch) | |
tree | 1b626780670104d2d32eb8e71f055f0b69a20b42 /drivers/net/dsa/mv88e6xxx.h | |
parent | 8cd14ccbfdba76d0eae13414a85865294fb98df8 (diff) | |
download | linux-158bc065f29c9be0919d18aefab320161936b3a8.tar.bz2 |
net: dsa: mv88e6xxx: replace ds with ps where possible
The dsa_switch structure ds is actually needed in very few places,
mostly during setup of the switch. The private structure ps is however
needed nearly everywhere. Pass ps, not ds internally.
[vd: rebased Andrew's patch.]
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx.h')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h index 0dbe2d1779dd..4f455d219859 100644 --- a/drivers/net/dsa/mv88e6xxx.h +++ b/drivers/net/dsa/mv88e6xxx.h @@ -388,6 +388,9 @@ struct mv88e6xxx_priv_state { /* The dsa_switch this private structure is related to */ struct dsa_switch *ds; + /* The device this structure is associated to */ + struct device *dev; + /* When using multi-chip addressing, this mutex protects * access to the indirect access registers. (In single-chip * mode, this mutex is effectively useless.) @@ -446,17 +449,18 @@ struct mv88e6xxx_hw_stat { enum stat_type type; }; -int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active); +int mv88e6xxx_switch_reset(struct mv88e6xxx_priv_state *ps, bool ppu_active); const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev, int sw_addr, void **priv, const struct mv88e6xxx_info *table, unsigned int num); int mv88e6xxx_setup_ports(struct dsa_switch *ds); -int mv88e6xxx_setup_common(struct dsa_switch *ds); +int mv88e6xxx_setup_common(struct mv88e6xxx_priv_state *ps); int mv88e6xxx_setup_global(struct dsa_switch *ds); -int mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg); -int mv88e6xxx_reg_write(struct dsa_switch *ds, int addr, int reg, u16 val); +int mv88e6xxx_reg_read(struct mv88e6xxx_priv_state *ps, int addr, int reg); +int mv88e6xxx_reg_write(struct mv88e6xxx_priv_state *ps, int addr, + int reg, u16 val); int mv88e6xxx_set_addr_direct(struct dsa_switch *ds, u8 *addr); int mv88e6xxx_set_addr_indirect(struct dsa_switch *ds, u8 *addr); int mv88e6xxx_phy_read(struct dsa_switch *ds, int port, int regnum); @@ -464,7 +468,7 @@ int mv88e6xxx_phy_write(struct dsa_switch *ds, int port, int regnum, u16 val); int mv88e6xxx_phy_read_indirect(struct dsa_switch *ds, int port, int regnum); int mv88e6xxx_phy_write_indirect(struct dsa_switch *ds, int port, int regnum, u16 val); -void mv88e6xxx_ppu_state_init(struct dsa_switch *ds); +void mv88e6xxx_ppu_state_init(struct mv88e6xxx_priv_state *ps); int mv88e6xxx_phy_read_ppu(struct dsa_switch *ds, int addr, int regnum); int mv88e6xxx_phy_write_ppu(struct dsa_switch *ds, int addr, int regnum, u16 val); |