[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240219155346.GE40273@kernel.org>
Date: Mon, 19 Feb 2024 15:53:46 +0000
From: Simon Horman <horms@...nel.org>
To: Yang Xiwen <forbidden405@...look.com>
Cc: Yisen Zhuang <yisen.zhuang@...wei.com>,
Salil Mehta <salil.mehta@...wei.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Yang Xiwen <forbidden405@...mail.com>, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v2 1/6] net: hisilicon: add support for hisi_femac core
on Hi3798MV200
On Fri, Feb 16, 2024 at 06:02:00PM +0800, Yang Xiwen via B4 Relay wrote:
..
> @@ -826,15 +847,32 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
> priv->phy_reset_delays,
> DELAYS_NUM);
> if (ret)
> - goto out_disable_clk;
> + goto out_free_netdev;
> hisi_femac_phy_reset(priv);
> }
>
> + // Register the optional MDIO bus
> + for_each_available_child_of_node(node, mdio_np) {
> + if (of_node_name_prefix(mdio_np, "mdio")) {
> + priv->mdio_pdev = of_platform_device_create(mdio_np, NULL, dev);
> + of_node_put(mdio_np);
> + if (!priv->mdio_pdev) {
> + dev_err(dev, "failed to register MDIO bus device\n");
> + goto out_free_netdev;
Hi Yang Xiwen,
out_free_netdev will return ret.
However, it seems that ret is uninitialised here.
Perhaps it should be set to a negative error value?
Flagged by Smatch.
> + }
> + mdio_registered = true;
> + break;
> + }
> + }
> +
> + if (!mdio_registered)
> + dev_warn(dev, "MDIO subnode notfound. This is usually a bug.\n");
> +
> phy = of_phy_get_and_connect(ndev, node, hisi_femac_adjust_link);
> if (!phy) {
> dev_err(dev, "connect to PHY failed!\n");
> ret = -ENODEV;
> - goto out_disable_clk;
> + goto out_unregister_mdio_bus;
> }
>
> phy_attached_print(phy, "phy_id=0x%.8lx, phy_mode=%s\n",
..
Powered by blists - more mailing lists