diff options
author | Andrew Lunn <andrew@lunn.ch> | 2019-11-05 01:13:00 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-06 03:09:45 +0100 |
commit | c5f299d592617847124900d75e5765cb0368ffae (patch) | |
tree | 52f550d054ba29b3760d5468103131c931fd654c /drivers/net/dsa/mv88e6xxx/global2.c | |
parent | net: dsa: mv88e6xxx: global2: Expose ATU stats register (diff) | |
download | linux-c5f299d592617847124900d75e5765cb0368ffae.tar.xz linux-c5f299d592617847124900d75e5765cb0368ffae.zip |
net: dsa: mv88e6xxx: global1_atu: Add helper for get next
When retrieving the ATU statistics, and ATU get next has to be
performed to trigger the ATU to collect the statistics. Export a
helper from global1_atu to perform this.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/global2.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/global2.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/global2.c b/drivers/net/dsa/mv88e6xxx/global2.c index 14954d92c564..87bfe7c8c9cd 100644 --- a/drivers/net/dsa/mv88e6xxx/global2.c +++ b/drivers/net/dsa/mv88e6xxx/global2.c @@ -288,16 +288,9 @@ int mv88e6xxx_g2_atu_stats_set(struct mv88e6xxx_chip *chip, u16 kind, u16 bin) kind | bin); } -int mv88e6xxx_g2_atu_stats_get(struct mv88e6xxx_chip *chip) +int mv88e6xxx_g2_atu_stats_get(struct mv88e6xxx_chip *chip, u16 *stats) { - int err; - u16 val; - - err = mv88e6xxx_g2_read(chip, MV88E6XXX_G2_ATU_STATS, &val); - if (err) - return err; - - return val & MV88E6XXX_G2_ATU_STATS_MASK; + return mv88e6xxx_g2_read(chip, MV88E6XXX_G2_ATU_STATS, stats); } /* Offset 0x0F: Priority Override Table */ |