public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Sean Anderson <sean.anderson@seco.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] usb: ulpi: Move of_node_put to ulpi_dev_release
Date: Mon, 31 Jan 2022 13:07:13 +0200	[thread overview]
Message-ID: <YffC4a1GUVp4wk+g@kuha.fi.intel.com> (raw)
In-Reply-To: <20220127190004.1446909-2-sean.anderson@seco.com>

On Thu, Jan 27, 2022 at 02:00:02PM -0500, Sean Anderson wrote:
> Drivers are not unbound from the device when ulpi_unregister_interface
> is called. Move of_node-freeing code to ulpi_dev_release which is called
> only after all users are gone.
> 
> Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT")
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>

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

> ---
> 
> Changes in v3:
> - Use separate patch for moving of_node_put from unregister to release
> 
>  drivers/usb/common/ulpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
> index 4169cf40a03b..c90a1ab705a3 100644
> --- a/drivers/usb/common/ulpi.c
> +++ b/drivers/usb/common/ulpi.c
> @@ -127,6 +127,7 @@ static const struct attribute_group *ulpi_dev_attr_groups[] = {
>  
>  static void ulpi_dev_release(struct device *dev)
>  {
> +	of_node_put(dev->of_node);
>  	kfree(to_ulpi_dev(dev));
>  }
>  
> @@ -296,7 +297,6 @@ EXPORT_SYMBOL_GPL(ulpi_register_interface);
>   */
>  void ulpi_unregister_interface(struct ulpi *ulpi)
>  {
> -	of_node_put(ulpi->dev.of_node);
>  	device_unregister(&ulpi->dev);
>  }
>  EXPORT_SYMBOL_GPL(ulpi_unregister_interface);
> -- 
> 2.25.1

thanks,

-- 
heikki

  reply	other threads:[~2022-01-31 11:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 19:00 [PATCH v3 0/3] usb: ulpi: Fixes and debugfs support Sean Anderson
2022-01-27 19:00 ` [PATCH v3 1/3] usb: ulpi: Move of_node_put to ulpi_dev_release Sean Anderson
2022-01-31 11:07   ` Heikki Krogerus [this message]
2022-01-27 19:00 ` [PATCH v3 2/3] usb: ulpi: Call of_node_put correctly Sean Anderson
2022-01-31 11:08   ` Heikki Krogerus
2022-01-27 19:00 ` [PATCH v3 3/3] usb: ulpi: Add debugfs support Sean Anderson
2022-01-31 11:10   ` Heikki Krogerus

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=YffC4a1GUVp4wk+g@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sean.anderson@seco.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