From: Krzysztof Kozlowski <krzk@kernel.org>
To: Jack Ping CHNG <jchng@maxlinear.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
davem@davemloft.net, andrew+netdev@lunn.ch, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, yzhu@maxlinear.com,
sureshnagaraj@maxlinear.com
Subject: Re: [PATCH net-next v3 2/2] net: maxlinear: Add support for MxL LGM SoC
Date: Mon, 1 Sep 2025 07:01:05 +0200 [thread overview]
Message-ID: <20250901-lumpy-lilac-ara-add2e2@kuoka> (raw)
In-Reply-To: <20250829124843.881786-3-jchng@maxlinear.com>
On Fri, Aug 29, 2025 at 08:48:43PM +0800, Jack Ping CHNG wrote:
> +
> +static int mxl_eth_probe(struct platform_device *pdev)
> +{
> + struct mxl_eth_drvdata *drvdata;
> + struct device_node *eth_np, *np;
> + struct reset_control *rst;
> + int ret, i = 0;
> +
> + drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
> + if (!drvdata)
> + return -ENOMEM;
> +
> + drvdata->port_base =
> + devm_platform_ioremap_resource_byname(pdev, "port");
Very odd wrapping. That's one line or wrap according to Linux coding
style.
> + if (IS_ERR(drvdata->port_base))
> + return PTR_ERR(drvdata->port_base);
> +
> + drvdata->ctrl_base =
> + devm_platform_ioremap_resource_byname(pdev, "ctrl");
Fix wrapping
> + if (IS_ERR(drvdata->ctrl_base))
> + return PTR_ERR(drvdata->ctrl_base);
> +
> + drvdata->clks = devm_clk_get_enabled(&pdev->dev, "ethif");
> + if (IS_ERR(drvdata->clks))
> + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->clks),
> + "failed to get/enable clock\n");
> +
> + rst = devm_reset_control_get(&pdev->dev, NULL);
> + if (IS_ERR(rst))
> + return dev_err_probe(&pdev->dev, PTR_ERR(rst),
> + "failed to get reset control\n");
> +
> + reset_control_assert(rst);
> + udelay(1);
> + reset_control_deassert(rst);
> +
> + platform_set_drvdata(pdev, drvdata);
> +
> + eth_np = of_get_child_by_name(pdev->dev.of_node, "ethernet-ports");
> + if (!eth_np)
> + return dev_err_probe(&pdev->dev, -ENODEV,
> + "no ethernet-ports node found!\n");
> +
> + for_each_available_child_of_node(eth_np, np) {
No, I asked you to use scoped loop.
> + ret = mxl_eth_create_ndev(pdev, np, &drvdata->ndevs[i++]);
> + if (ret) {
> + of_node_put(np);
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-09-01 5:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 12:48 [PATCH net-next v3 0/2] Add MxL Ethernet driver & devicetree binding Jack Ping CHNG
2025-08-29 12:48 ` [PATCH net-next v3 1/2] dt-bindings: net: mxl: Add MxL LGM Network Processor SoC Jack Ping CHNG
2025-09-01 4:59 ` Krzysztof Kozlowski
2025-08-29 12:48 ` [PATCH net-next v3 2/2] net: maxlinear: Add support for MxL LGM SoC Jack Ping CHNG
2025-08-29 20:24 ` Andrew Lunn
2025-09-01 9:38 ` Jack Ping Chng
2025-09-01 13:11 ` Andrew Lunn
2025-09-02 10:39 ` Jack Ping Chng
2025-09-02 12:30 ` Andrew Lunn
2025-09-04 6:33 ` Jack Ping Chng
2025-09-04 12:20 ` Andrew Lunn
2025-08-29 20:29 ` Andrew Lunn
2025-09-01 5:01 ` Krzysztof Kozlowski [this message]
2025-09-02 8:46 ` Simon Horman
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=20250901-lumpy-lilac-ara-add2e2@kuoka \
--to=krzk@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=jchng@maxlinear.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=sureshnagaraj@maxlinear.com \
--cc=yzhu@maxlinear.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).