Re: [PATCH net-next v2 2/4] net: dsa: yt921x: Refactor long register helpers

From: Andrew Lunn

Date: Thu Apr 02 2026 - 20:26:39 EST


> -static int yt921x_reg64_write(struct yt921x_priv *priv, u32 reg, u64 val)

> +yt921x_reg64_write(struct yt921x_priv *priv, u32 reg, const u32 *vals)
> +{

The old reg64_write actually took a u64 value, so the name fit. The
new one takes 2x a u32. So i'm not sure calling is reg64 actually
fits. Maybe yt921x_reg32x2_write()?

> +static int yt921x_vlan_del(struct yt921x_priv *priv, int port, u16 vid)
> {
> - u64 mask64;
> + u32 masks[2];
>
> - mask64 = YT921X_VLAN_CTRL_PORTS(port) |
> - YT921X_VLAN_CTRL_UNTAG_PORTn(port);
> + masks[0] = YT921X_VLAN_CTRLa_PORTn(port);
> + masks[1] = YT921X_VLAN_CTRLb_UNTAG_PORTn(port);
>
> - return yt921x_reg64_clear_bits(priv, YT921X_VLANn_CTRL(vid), mask64);
> + return yt921x_reg64_clear_bits(priv, YT921X_VLANn_CTRL(vid), masks);

Or you could make yt921x_reg64_write() continue to take a u64, and
avoid all these changes?

How does the datasheet describe these registers? Are they 64bit
registers, or 2x 32bit registers?

Andrew