All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Liang He <windhl@126.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb: typec: anx7411: Use of_get_child_by_name() instead of of_find_node_by_name()
Date: Fri, 16 Sep 2022 12:58:47 +0300	[thread overview]
Message-ID: <YyRI12FZYWCG7KNw@kuha.fi.intel.com> (raw)
In-Reply-To: <20220915092209.4009273-1-windhl@126.com>

On Thu, Sep 15, 2022 at 05:22:09PM +0800, Liang He wrote:
> In anx7411_typec_switch_probe(), we should call of_get_child_by_name()
> instead of of_find_node_by_name() as of_find_xxx API will decrease the
> refcount of the 'from' argument.
> 
> Fixes: fe6d8a9c8e64 ("usb: typec: anx7411: Add Analogix PD ANX7411 support")
> Signed-off-by: Liang He <windhl@126.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  
>  v2: use of_get_child_by_name() advised by Heikki Krogerus.
> 
>  drivers/usb/typec/anx7411.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/anx7411.c b/drivers/usb/typec/anx7411.c
> index c0f0842d443c..f178d0eb47b1 100644
> --- a/drivers/usb/typec/anx7411.c
> +++ b/drivers/usb/typec/anx7411.c
> @@ -1105,7 +1105,7 @@ static int anx7411_typec_switch_probe(struct anx7411_data *ctx,
>  	int ret;
>  	struct device_node *node;
>  
> -	node = of_find_node_by_name(dev->of_node, "orientation_switch");
> +	node = of_get_child_by_name(dev->of_node, "orientation_switch");
>  	if (!node)
>  		return 0;
>  
> @@ -1115,7 +1115,7 @@ static int anx7411_typec_switch_probe(struct anx7411_data *ctx,
>  		return ret;
>  	}
>  
> -	node = of_find_node_by_name(dev->of_node, "mode_switch");
> +	node = of_get_child_by_name(dev->of_node, "mode_switch");
>  	if (!node) {
>  		dev_err(dev, "no typec mux exist");
>  		ret = -ENODEV;

thanks,

-- 
heikki

      reply	other threads:[~2022-09-16  9:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15  9:22 [PATCH v2] usb: typec: anx7411: Use of_get_child_by_name() instead of of_find_node_by_name() Liang He
2022-09-16  9:58 ` Heikki Krogerus [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=YyRI12FZYWCG7KNw@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.