[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a50f9f86-b0f4-484a-85ef-9dd1e5737d83@wanadoo.fr>
Date: Thu, 12 Dec 2024 09:18:04 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Chris Packham <chris.packham@...iedtelesis.co.nz>, lee@...nel.org,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, tsbogend@...ha.franken.de,
hkallweit1@...il.com, linux@...linux.org.uk, markus.stockhausen@....de
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, linux-mips@...r.kernel.org
Subject: Re: [PATCH 4/4] net: mdio: Add RTL9300 MDIO driver
Le 12/12/2024 à 00:53, Chris Packham a écrit :
> Add a driver for the MDIO controller on the RTL9300 family of Ethernet
> switches with integrated SoC. There are 4 physical SMI interfaces on the
> RTL9300 but access is done using the switch ports so a single MDIO bus
> is presented to the rest of the system.
>
> Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
...
> + err = regmap_write(priv->regmap, priv->reg_base + SMI_ACCESS_PHY_CTRL_1,
> + PHY_CTRL_RWOP | PHY_CTRL_TYPE | PHY_CTRL_CMD);
> + if (err)
> + return err;
> +
> + err = regmap_read_poll_timeout(priv->regmap, priv->reg_base + SMI_ACCESS_PHY_CTRL_1,
> + val, !(val & PHY_CTRL_CMD), 10, 100);
> + if (err)
> + return err;
> +
> + if (val & PHY_CTRL_FAIL) {
> + err = -ENXIO;
> + return err;
Nitpick: return -ENXIO; and remove the { }
> + }
> +
> + return err;
Nitpick: return 0;
> +}
> +
> +static int realtek_mdiobus_init(struct realtek_mdio_priv *priv)
> +{
> + u32 port_addr[5] = { };
> + u32 poll_sel[2] = { 0, 0 };
Nitpick: Why {} in on case and {0,0} in the other one?
> + u32 glb_ctrl_mask = 0, glb_ctrl_val = 0;
> + int i, err;
> +
> + for (i = 0; i < MAX_PORTS; i++) {
> + int pos;
> +
> + if (priv->smi_bus[i] > 3)
> + continue;
> +
> + pos = (i % 6) * 5;
> + port_addr[i / 6] |= priv->smi_addr[i] << pos;
> +
> + pos = (i % 16) * 2;
> + poll_sel[i / 16] |= priv->smi_bus[i] << pos;
> + }
...
CJ
Powered by blists - more mailing lists