[RFC PATCH net-next v3 03/15] net: dsa: mt7530: use regmap to access switch register space
Andrew Lunn
andrew at lunn.ch
Wed Mar 29 09:24:21 PDT 2023
Thanks for splitting this patchset up. This is much easier to review.
> +static u32
> +mt7530_mii_read(struct mt7530_priv *priv, u32 reg)
> +{
> + int ret;
> + u32 val;
> +
> + ret = regmap_read(priv->regmap, reg, &val);
> + if (ret) {
> + dev_err(priv->dev,
> + "failed to read mt7530 register\n");
> + return ret;
This is a u32 function. ret should be negative on error, which is
going to be turned positive in order to return a u32. So you probably
want to make this an int function.
Andrew
More information about the linux-arm-kernel
mailing list