[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJ6orOpINGHT6kZD@lunn.ch>
Date: Fri, 14 May 2021 18:43:24 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Ansuel Smith <ansuelsmth@...il.com>
Cc: Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"open list:NETWORKING DRIVERS" <netdev@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH net-next v5 07/25] net: dsa: qca8k: handle error with
qca8k_rmw operation
> -static u32
> -qca8k_rmw(struct qca8k_priv *priv, u32 reg, u32 mask, u32 val)
> +static int
> +qca8k_rmw(struct qca8k_priv *priv, u32 reg, u32 mask, u32 write_val)
> {
> struct mii_bus *bus = priv->bus;
> u16 r1, r2, page;
> - u32 ret;
> + u32 val;
> + int ret;
>
> qca8k_split_addr(reg, &r1, &r2, &page);
>
> @@ -205,10 +206,15 @@ qca8k_rmw(struct qca8k_priv *priv, u32 reg, u32 mask, u32 val)
> if (ret < 0)
> goto exit;
>
> - ret = qca8k_mii_read32(bus, 0x10 | r2, r1);
> - ret &= ~mask;
> - ret |= val;
> - qca8k_mii_write32(bus, 0x10 | r2, r1, ret);
> + val = qca8k_mii_read32(bus, 0x10 | r2, r1);
> + if (val < 0) {
> + ret = val;
> + goto exit;
> + }
> +
> + val &= ~mask;
> + val |= write_val;
> + qca8k_mii_write32(bus, 0x10 | r2, r1, val);
Does qca8k_mii_write32() not return an code?
Seems like yet another function you could modify. But i suggest you
wait, get this patchset merged first.
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists