Re: [net-next RFC PATCH 1/4] net: dsa: qca8k: drop qca8k_read/write/rmw for regmap variant

Vladimir Oltean
2022-07-18T18:05:03Z

On Sat, Jul 16, 2022 at 07:49:55PM +0200, Christian Marangi wrote:
> In preparation for code split, drop the remaining qca8k_read/write/rmw
> and use regmap helper directly.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
> drivers/net/dsa/qca/qca8k.c | 206 +++++++++++++++++-------------------
> 1 file changed, 95 insertions(+), 111 deletions(-)
>
> diff --git a/drivers/net/dsa/qca/qca8k.c b/drivers/net/dsa/qca/qca8k.c
> index 1cbb05b0323f..2d34e15c2e6f 100644
> --- a/drivers/net/dsa/qca/qca8k.c
> +++ b/drivers/net/dsa/qca/qca8k.c
> @@ -184,24 +184,6 @@ qca8k_set_page(struct qca8k_priv *priv, u16 page)
> return 0;
> }
>
> -static int
> -qca8k_read(struct qca8k_priv *priv, u32 reg, u32 *val)
> -{
> - return regmap_read(priv->regmap, reg, val);
> -}
> -
> -static int
> -qca8k_write(struct qca8k_priv *priv, u32 reg, u32 val)
> -{
> - return regmap_write(priv->regmap, reg, val);
> -}
> -
> -static int
> -qca8k_rmw(struct qca8k_priv *priv, u32 reg, u32 mask, u32 write_val)
> -{
> - return regmap_update_bits(priv->regmap, reg, mask, write_val);
> -}
> -

Could you please explain slowly to me why this change is needed? I don't get it.
Can't qca8k_read(), qca8k_write() and qca8k_rmw() be part of qca8k-common.c?