Re: [net-next v2 3/7] net: ftgmac100: Add reset toggling for Aspeed SOCs

From: Arnd Bergmann
Date: Mon Nov 18 2024 - 01:32:54 EST


On Mon, Nov 18, 2024, at 07:02, Jacky Chou wrote:
> @@ -1969,10 +1971,29 @@ static int ftgmac100_probe(struct platform_device *pdev)
> }
>
> if (priv->is_aspeed) {
> + struct reset_control *rst;
> +
> err = ftgmac100_setup_clk(priv);
> if (err)
> goto err_phy_connect;
>
> + rst = devm_reset_control_get_optional(priv->dev, NULL);
> + if (IS_ERR(rst))
> + goto err_register_netdev;
> + priv->rst = rst;
> +
> + err = reset_control_assert(priv->rst);

Since that reset line is optional, how about making it
part of the normal probe procedure, not just the if(aspeed)
section? It seems this does nothing for older devices but
may help for future ones regardless of the SoC family.

Arnd