Re: [PATCH net-next v2 1/2] mv88e6xxx: Refactor 6352's serdes functions

Andrew Lunn
2026-04-30T19:06:11Z

> @@ -185,7 +200,7 @@ size_t mv88e6352_serdes_get_stats(struct mv88e6xxx_chip *chip, int port,
>
> for (i = 0; i < ARRAY_SIZE(mv88e6352_serdes_hw_stats); i++) {
> stat = &mv88e6352_serdes_hw_stats[i];
> - value = mv88e6352_serdes_get_stat(chip, stat);
> + value = mv88e6352_serdes_get_stat(chip, MV88E6352_ADDR_SERDES, stat);

If you generalise this, you can use the same code for the mv88e6321.

> +void mv88e6352_serdes_get_regs(struct mv88e6xxx_chip *chip, int port, void *_p)
> +{
> + int err;
> +
> + err = mv88e6352_g2_scratch_port_has_serdes(chip, port);
> + if (err <= 0)
> + return;
> +
> + mv88e6352_serdes_get_regs_from_lane(chip, MV88E6352_ADDR_SERDES, _p);

Here as well.

This is however looking a lot better. Thanks for the generalisation
patch.

Andrew

---
pw-bot: cr