devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Yang Xiwen <forbidden405@outlook.com>
Cc: Yisen Zhuang <yisen.zhuang@huawei.com>,
	Salil Mehta <salil.mehta@huawei.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Yang Xiwen <forbidden405@foxmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 1/6] net: hisilicon: add support for hisi_femac core on Hi3798MV200
Date: Mon, 19 Feb 2024 15:53:46 +0000	[thread overview]
Message-ID: <20240219155346.GE40273@kernel.org> (raw)
In-Reply-To: <20240216-net-v2-1-89bd4b7065c2@outlook.com>

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",

...

  reply	other threads:[~2024-02-19 15:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 10:01 [PATCH v2 0/6] net: hisi-femac: add support for Hi3798MV200, remove unmaintained compatibles Yang Xiwen via B4 Relay
2024-02-16 10:02 ` [PATCH v2 1/6] net: hisilicon: add support for hisi_femac core on Hi3798MV200 Yang Xiwen via B4 Relay
2024-02-19 15:53   ` Simon Horman [this message]
2024-02-19 15:56     ` Yang Xiwen
2024-02-16 10:02 ` [PATCH v2 2/6] net: hisi_femac: remove unused compatible strings Yang Xiwen via B4 Relay
2024-02-16 10:02 ` [PATCH v2 3/6] dt-bindings: net: remove outdated hisilicon-femac Yang Xiwen via B4 Relay
2024-02-16 10:02 ` [PATCH v2 4/6] dt-bindings: net: add hisilicon,hisi-femac Yang Xiwen via B4 Relay
2024-02-16 11:50   ` Rob Herring
2024-02-16 11:53     ` Yang Xiwen
2024-02-16 13:40       ` Andrew Lunn
2024-02-16 10:02 ` [PATCH v2 5/6] net: mdio: hisi-femac: make clock optional Yang Xiwen via B4 Relay
2024-02-16 10:02 ` [PATCH v2 6/6] dt-bindings: net: hisilicon-femac-mdio: convert to YAML Yang Xiwen via B4 Relay
2024-02-16 13:37 ` [PATCH v2 0/6] net: hisi-femac: add support for Hi3798MV200, remove unmaintained compatibles Andrew Lunn
2024-02-16 13:38   ` Yang Xiwen
2024-02-16 14:11     ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240219155346.GE40273@kernel.org \
    --to=horms@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=forbidden405@foxmail.com \
    --cc=forbidden405@outlook.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).