linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	linux-samsung-soc@vger.kernel.org,
	Neil Armstrong <narmstrong@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Kevin Hilman <khilman@baylibre.com>,
	linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
	Andy Gross <agross@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Patrice Chotard <patrice.chotard@st.com>,
	Kukjin Kim <kgene@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [PATCH usb-next] usb: dwc3: Use devm_of_platform_populate
Date: Mon, 9 Nov 2020 10:34:14 +0000	[thread overview]
Message-ID: <20201109103414.GF1559@shell.armlinux.org.uk> (raw)
In-Reply-To: <20201109095953.7f810239@xhacker.debian>

On Mon, Nov 09, 2020 at 09:59:53AM +0800, Jisheng Zhang wrote:
> diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
> index 417e05381b5d..83015bb7b926 100644
> --- a/drivers/usb/dwc3/dwc3-meson-g12a.c
> +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
> @@ -702,7 +702,6 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
>  {
>  	struct dwc3_meson_g12a	*priv;
>  	struct device		*dev = &pdev->dev;
> -	struct device_node	*np = dev->of_node;
>  	void __iomem *base;
>  	int ret, i;
>  
> @@ -794,7 +793,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
>  			goto err_phys_power;
>  	}
>  
> -	ret = of_platform_populate(np, NULL, NULL, dev);
> +	ret = devm_of_platform_populate(dev);
>  	if (ret)
>  		goto err_phys_power;
>  
> @@ -832,8 +831,6 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev)
>  	if (priv->drvdata->otg_switch_supported)
>  		usb_role_switch_unregister(priv->role_switch);
>  
> -	of_platform_depopulate(dev);
> -
>  	for (i = 0 ; i < PHY_COUNT ; ++i) {
>  		phy_power_off(priv->phys[i]);
>  		phy_exit(priv->phys[i]);

Does it matter that the order that things happen in
dwc3_meson_g12a_remove() is changed as a result of your patch? Was
the code relying on the platform devices being depopulated before
powering off the PHYs?

> diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
> index e62ecd22b3ed..f1c267e39d62 100644
> --- a/drivers/usb/dwc3/dwc3-of-simple.c
> +++ b/drivers/usb/dwc3/dwc3-of-simple.c
> @@ -73,7 +73,7 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto err_resetc_assert;
>  
> -	ret = of_platform_populate(np, NULL, NULL, dev);
> +	ret = devm_of_platform_populate(dev);
>  	if (ret)
>  		goto err_clk_put;
>  
> @@ -97,8 +97,6 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
>  
>  static void __dwc3_of_simple_teardown(struct dwc3_of_simple *simple)
>  {
> -	of_platform_depopulate(simple->dev);
> -
>  	clk_bulk_disable_unprepare(simple->num_clocks, simple->clks);
>  	clk_bulk_put_all(simple->num_clocks, simple->clks);
>  	simple->num_clocks = 0;

Same here... and for anywhere else in this patch that you're deleting
a of_platform_depopulate().

You effectively are moving the call to of_platform_depopulate() *after*
the driver's .remove function has been called.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2020-11-09 10:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09  1:59 [PATCH usb-next] usb: dwc3: Use devm_of_platform_populate Jisheng Zhang
2020-11-09 10:34 ` Russell King - ARM Linux admin [this message]
2020-11-09 11:12   ` Jisheng Zhang

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=20201109103414.GF1559@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Jisheng.Zhang@synaptics.com \
    --cc=agross@kernel.org \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbrunet@baylibre.com \
    --cc=kgene@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=krzk@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=patrice.chotard@st.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).