{
struct mv88e6xxx_chip *chip = ds->priv;
+ mutex_lock(&chip->reg_lock);
+
if (chip->info->ops->stats_get_strings)
chip->info->ops->stats_get_strings(chip, data);
+
+ mutex_unlock(&chip->reg_lock);
}
static int mv88e6xxx_stats_get_sset_count(struct mv88e6xxx_chip *chip,
static int mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port)
{
struct mv88e6xxx_chip *chip = ds->priv;
+ int ret = 0;
+ mutex_lock(&chip->reg_lock);
if (chip->info->ops->stats_get_sset_count)
- return chip->info->ops->stats_get_sset_count(chip);
+ ret = chip->info->ops->stats_get_sset_count(chip);
+ mutex_unlock(&chip->reg_lock);
- return 0;
+ return ret;
}
static void mv88e6xxx_stats_get_stats(struct mv88e6xxx_chip *chip, int port,