[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJq09z6J7oHi7D054fQZO_JkAgmDdRHZHmz0qE3oGb2+_pzQxQ@mail.gmail.com>
Date: Sat, 18 Dec 2021 03:24:06 -0300
From: Luiz Angelo Daros de Luca <luizluca@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
vivien.didelot@...il.com, Florian Fainelli <f.fainelli@...il.com>,
olteanv@...il.com,
Alvin Šipraga <ALSI@...g-olufsen.dk>,
Arınç ÜNAL <arinc.unal@...nc9.com>
Subject: Re: [PATCH net-next 05/13] net: dsa: realtek: use phy_read in ds->ops
> On Thu, Dec 16, 2021 at 9:14 PM <luizluca@...il.com> wrote:
> > From: Luiz Angelo Daros de Luca <luizluca@...il.com>
> >
> > The ds->ops->phy_read will only be used if the ds->slave_mii_bus
> > was not initialized. Calling realtek_smi_setup_mdio will create a
> > ds->slave_mii_bus, making ds->ops->phy_read dormant.
> >
> > Using ds->ops->phy_read will allow switches connected through non-SMI
> > interfaces (like mdio) to let ds allocate slave_mii_bus and reuse the
> > same code.
> >
> > Tested-by: Arınç ÜNAL <arinc.unal@...nc9.com>
> > Signed-off-by: Luiz Angelo Daros de Luca <luizluca@...il.com>
> (...)
> > -static int rtl8365mb_phy_read(struct realtek_priv *priv, int phy, int regnum)
> > +static int rtl8365mb_phy_read(struct dsa_switch *ds, int phy, int regnum)
> > {
> > u32 ocp_addr;
> > u16 val;
> > int ret;
> > + struct realtek_priv *priv = ds->priv;
>
> Needs to be on top (reverse christmas tree, christmas is getting close).
>
> > -static int rtl8365mb_phy_write(struct realtek_priv *priv, int phy, int regnum,
> > +static int rtl8365mb_phy_write(struct dsa_switch *ds, int phy, int regnum,
> > u16 val)
> > {
> > u32 ocp_addr;
> > int ret;
> > + struct realtek_priv *priv = (struct realtek_priv *)ds->priv;
>
> Dito.
>
> > -static int rtl8366rb_phy_read(struct realtek_priv *priv, int phy, int regnum)
> > +static int rtl8366rb_phy_read(struct dsa_switch *ds, int phy, int regnum)
> > {
> > u32 val;
> > u32 reg;
> > int ret;
> > + struct realtek_priv *priv = ds->priv;
>
> Dito.
>
> > -static int rtl8366rb_phy_write(struct realtek_priv *priv, int phy, int regnum,
> > +static int rtl8366rb_phy_write(struct dsa_switch *ds, int phy, int regnum,
> > u16 val)
> > {
> > u32 reg;
> > int ret;
> > + struct realtek_priv *priv = ds->priv;
>
> Dito.
>
> Other than that it's a great patch, so with these nitpicky changes
> feel free to add:
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
>
Thanks! Fixed and added.
Powered by blists - more mailing lists