Re: [RFC v4 net-next 03/17] net: mscc: ocelot: expose stats layout definition to be used by other drivers

From: Vladimir Oltean
Date: Wed Oct 12 2022 - 05:20:26 EST


On Sat, Oct 08, 2022 at 11:51:38AM -0700, Colin Foster wrote:
> The ocelot_stats_layout array is common between several different chips,
> some of which can only be controlled externally. Export this structure so
> it doesn't have to be duplicated in these other drivers.
>
> Rename the structure as well, to follow the conventions of other shared
> resources.
>
> Signed-off-by: Colin Foster <colin.foster@xxxxxxxxxxxxxxxx>
> ---

I see that ocelot->stats_layout has become a redundant indirection.
It no longer contains anything hardware-specific. The register offsets
are now part of the switch-specific sys_regmap.

Could you please refactor the code to use a single static const struct
ocelot_stats_layout in ocelot_stats.c, and remove felix->info->stats_layout
and ocelot->stats_layout?