Netdev List
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Liang He <windhl@126.com>
Cc: <andrew@lunn.ch>, <hkallweit1@gmail.com>, <linux@armlinux.org.uk>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<david.daney@cavium.com>
Subject: Re: [PATCH] net: mdio: thunder: Add missing fwnode_handle_put()
Date: Wed, 22 Mar 2023 09:55:38 +0100	[thread overview]
Message-ID: <20230322085538.pn57j2b5dyxizb4o@soft-dev3-1> (raw)
In-Reply-To: <20230322062057.1857614-1-windhl@126.com>

The 03/22/2023 14:20, Liang He wrote:
> 
> In device_for_each_child_node(), we should add fwnode_handle_put()
> when break out of the iteration device_for_each_child_node()
> as it will automatically increase and decrease the refcounter.

Don't forget to mention the tree which you are targeting.
It shoud be something like:
"[PATCH net] net: mdio: thunder: Add missing fwnode_handle_put()" and
you can achieve this using option --subject-prefix when you create your
patch:
git format-patch ... --subject-prefix "PATCH net"


> 
> Fixes: 379d7ac7ca31 ("phy: mdio-thunder: Add driver for Cavium Thunder SoC MDIO buses.")
> Signed-off-by: Liang He <windhl@126.com>
> ---
>  drivers/net/mdio/mdio-thunder.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/mdio/mdio-thunder.c b/drivers/net/mdio/mdio-thunder.c
> index 822d2cdd2f35..394b864aaa37 100644
> --- a/drivers/net/mdio/mdio-thunder.c
> +++ b/drivers/net/mdio/mdio-thunder.c
> @@ -104,6 +104,7 @@ static int thunder_mdiobus_pci_probe(struct pci_dev *pdev,
>                 if (i >= ARRAY_SIZE(nexus->buses))
>                         break;
>         }
> +       fwnode_handle_put(fwn);

Can you declare only 1 mdio bus in the DT under this pci device?
Because in that case, I don't think this is correct, because then
'device_for_each_child_node' will exit before all 4 mdio buses are probed.
And according to the comments for 'fwnode_handle_put' you need to use
with break or return.

>         return 0;
> 
>  err_release_regions:
> --
> 2.25.1
> 

-- 
/Horatiu

  reply	other threads:[~2023-03-22  8:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  6:20 [PATCH] net: mdio: thunder: Add missing fwnode_handle_put() Liang He
2023-03-22  8:55 ` Horatiu Vultur [this message]
2023-03-23  1:53   ` Liang He
2023-03-23  7:36     ` Horatiu Vultur
2023-03-23  8:50 ` patchwork-bot+netdevbpf

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=20230322085538.pn57j2b5dyxizb4o@soft-dev3-1 \
    --to=horatiu.vultur@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=david.daney@cavium.com \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=windhl@126.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