Re: [RFC PATCH 6/8] net: pcs: add driver for MediaTek USXGMII PCS

From: Philipp Zabel
Date: Mon Nov 27 2023 - 08:26:03 EST


On Do, 2023-11-09 at 21:51 +0000, Daniel Golle wrote:
> Add driver for USXGMII PCS found in the MediaTek MT7988 SoC and supporting
> USXGMII, 10GBase-R and 5GBase-R interface modes. In order to support
> Cisco SGMII, 1000Base-X and 2500Base-X via the also present LynxI PCS
> create a wrapped PCS taking care of the components shared between the
> new USXGMII PCS and the legacy LynxI PCS.
>
> Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>
> ---
[...]
> diff --git a/drivers/net/pcs/pcs-mtk-usxgmii.c b/drivers/net/pcs/pcs-mtk-usxgmii.c
> new file mode 100644
> index 0000000000000..b3ca66c9df2a9
> --- /dev/null
> +++ b/drivers/net/pcs/pcs-mtk-usxgmii.c
> @@ -0,0 +1,688 @@
[...]
> +static int mtk_sgmii_wrapper_init(struct mtk_usxgmii_pcs *mpcs)
> +{
> + struct device_node *r = mpcs->dev->of_node, *np;
[...]
> + rstc = of_reset_control_get_shared(r, "sgmii");
> +

Superfluous whitespace.

> + if (IS_ERR(rstc))
> + return PTR_ERR(rstc);

Here you correctly check rstc for errors ...

[...]
> + wp->reset = rstc;
[...]
> +
> + if (IS_ERR(wp->reset))
> + return PTR_ERR(wp->reset);

And here you check it again. The second check can be dropped.


regards
Philipp