Re: [RFC PATCH net-next v3 04/20] net: dsa: qca8k: handle qca8k_set_page errors

From: Andrew Lunn
Date: Tue May 04 2021 - 20:27:00 EST


> > @@ -161,14 +169,19 @@ static void
> > qca8k_write(struct qca8k_priv *priv, u32 reg, u32 val)
> > {
> > u16 r1, r2, page;
> > + int ret;
> >
> > qca8k_split_addr(reg, &r1, &r2, &page);
> >
> > mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);
> >
> > - qca8k_set_page(priv->bus, page);
> > + ret = qca8k_set_page(priv->bus, page);
> > + if (ret < 0)
> > + goto exit;
> > +
> > qca8k_mii_write32(priv->bus, 0x10 | r2, r1, val);
> >
> > +exit:
> > mutex_unlock(&priv->bus->mdio_lock);
>
> Maybe make this function also return the error?

Ah, sorry, a later patch does exactly that.

Andrew