From: quic_zijuhu <quic_zijuhu@quicinc.com>
To: Paolo Abeni <pabeni@redhat.com>, Timur Tabi <timur@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Zijun Hu <zijun_hu@icloud.com>
Subject: Re: [PATCH net-next RESEND v5] net: qcom/emac: Find sgmii_ops by device_for_each_child()
Date: Fri, 4 Oct 2024 01:09:12 +0800 [thread overview]
Message-ID: <9b45a39b-c747-4597-95cc-01c752328aea@quicinc.com> (raw)
In-Reply-To: <308126dc-1a5d-480c-b8a2-053f73865f86@redhat.com>
On 10/3/2024 9:39 PM, Paolo Abeni wrote:
>> @@ -356,10 +363,14 @@ int emac_sgmii_config(struct platform_device
>> *pdev, struct emac_adapter *adpt)
>> int ret;
>> if (has_acpi_companion(&pdev->dev)) {
>> + struct emac_match_data match_data = {
>> + .sgmii_ops = &phy->sgmii_ops,
>> + .target_device = NULL,
>> + };
>> struct device *dev;
>> - dev = device_find_child(&pdev->dev, &phy->sgmii_ops,
>> - emac_sgmii_acpi_match);
>> + device_for_each_child(&pdev->dev, &match_data,
>> emac_sgmii_acpi_match);
>> + dev = match_data.target_device;
>> if (!dev) {
>> dev_warn(&pdev->dev, "cannot find internal phy node\n");
>
>
> I'm sorry for the late feedback. I agree with Greg, I think it would
> more clear removing the get_device() from the match function and add it
> here, after the 'if (!dev) {' statement.
>
Thank you for helping me understand those good suggestions.
will correct it within next revision.
> Thanks,
>
> Paolo
prev parent reply other threads:[~2024-10-03 17:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 11:32 Zijun Hu
2024-10-03 13:39 ` Paolo Abeni
2024-10-03 17:09 ` quic_zijuhu [this message]
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=9b45a39b-c747-4597-95cc-01c752328aea@quicinc.com \
--to=quic_zijuhu@quicinc.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=timur@kernel.org \
--cc=zijun_hu@icloud.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
all inboxes | Powered by JetHome®