Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1652605 > unrolled thread

[PATCH 00/15] make more driver use devm_of_platform_populate()

Started byBenjamin Gaignard <benjamin.gaignard@linaro.org>
First post2017-05-29 17:50 +0200
Last post2017-05-29 18:10 +0200
Articles 10 on this page of 30 — 7 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/15] make more driver use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
    [PATCH 11/15] mfd: palmas: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 11/15] mfd: palmas: use devm_of_platform_populate() Lee Jones <lee.jones@linaro.org> - 2017-05-30 11:40 +0200
    [PATCH 12/15] mfd: qcom-spmi-pmic: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
    [PATCH 13/15] mfd: smsc-ece: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 13/15] mfd: smsc-ece: use devm_of_platform_populate() Lee Jones <lee.jones@linaro.org> - 2017-05-30 11:40 +0200
    [PATCH 08/15] mfd: exynos: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 08/15] mfd: exynos: use devm_of_platform_populate() Lee Jones <lee.jones@linaro.org> - 2017-05-30 11:40 +0200
    [PATCH 02/15] iio: dac: stm32: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 02/15] iio: dac: stm32: use devm_of_platform_populate() Fabrice Gasnier <fabrice.gasnier@st.com> - 2017-05-29 18:20 +0200
    [PATCH 06/15] mfd: atmel: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
    [PATCH 09/15] mfd: fsl-imx25: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 09/15] mfd: fsl-imx25: use devm_of_platform_populate() Lee Jones <lee.jones@linaro.org> - 2017-05-30 11:40 +0200
    [PATCH 04/15] drm: msm: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
    [PATCH 15/15] media: exynos4-is: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
    [PATCH 14/15] sound: stm32: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 14/15] sound: stm32: use devm_of_platform_populate() Olivier MOYSAN <olivier.moysan@st.com> - 2017-05-30 11:10 +0200
    [PATCH 03/15] drm: zte: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 03/15] drm: zte: use devm_of_platform_populate() Shawn Guo <shawnguo@kernel.org> - 2017-06-05 04:00 +0200
    [PATCH 07/15] mfd: cros_ec: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
    [PATCH 05/15] mfd: stm32-timers: use devm_of_platform_populate Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 05/15] mfd: stm32-timers: use devm_of_platform_populate Lee Jones <lee.jones@linaro.org> - 2017-05-30 11:40 +0200
    [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate() Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-30 00:10 +0200
        Re: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-30 09:30 +0200
        Re: [PATCH 10/15] mfd: motorola-cpcap: use  devm_of_platform_populate() Lee Jones <lee.jones@linaro.org> - 2017-05-30 12:10 +0200
          Re: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate() Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-30 12:50 +0200
    [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-05-29 17:50 +0200
      Re: [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate() Fabrice Gasnier <fabrice.gasnier@st.com> - 2017-05-29 18:10 +0200
      Re: [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate() Jonathan Cameron <jic23@kernel.org> - 2017-05-29 18:10 +0200

Page 2 of 2 — ← Prev page 1 [2]


#1652619 — [PATCH 05/15] mfd: stm32-timers: use devm_of_platform_populate

FromBenjamin Gaignard <benjamin.gaignard@linaro.org>
Date2017-05-29 17:50 +0200
Subject[PATCH 05/15] mfd: stm32-timers: use devm_of_platform_populate
Message-ID<tMv5F-1UR-31@gated-at.bofh.it>
In reply to#1652605
Use devm_of_platform_populate() instead of of_platform_populate()
and suppress stm32_timers_remove() which become useless.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

CC: Lee Jones <lee.jones@linaro.org>
CC: Alexandre Torgue <alexandre.torgue@st.com>
CC: linux-arm-kernel@lists.infradead.org
CC: linux-kernel@vger.kernel.org
---
 drivers/mfd/stm32-timers.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/mfd/stm32-timers.c b/drivers/mfd/stm32-timers.c
index 2182f00..a6675a4 100644
--- a/drivers/mfd/stm32-timers.c
+++ b/drivers/mfd/stm32-timers.c
@@ -58,14 +58,7 @@ static int stm32_timers_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, ddata);
 
-	return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
-}
-
-static int stm32_timers_remove(struct platform_device *pdev)
-{
-	of_platform_depopulate(&pdev->dev);
-
-	return 0;
+	return devm_of_platform_populate(&pdev->dev);
 }
 
 static const struct of_device_id stm32_timers_of_match[] = {
@@ -76,7 +69,6 @@ static int stm32_timers_remove(struct platform_device *pdev)
 
 static struct platform_driver stm32_timers_driver = {
 	.probe = stm32_timers_probe,
-	.remove = stm32_timers_remove,
 	.driver	= {
 		.name = "stm32-timers",
 		.of_match_table = stm32_timers_of_match,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1653035 — Re: [PATCH 05/15] mfd: stm32-timers: use devm_of_platform_populate

FromLee Jones <lee.jones@linaro.org>
Date2017-05-30 11:40 +0200
SubjectRe: [PATCH 05/15] mfd: stm32-timers: use devm_of_platform_populate
Message-ID<tMLN8-5ya-7@gated-at.bofh.it>
In reply to#1652619
On Mon, 29 May 2017, Benjamin Gaignard wrote:

> Use devm_of_platform_populate() instead of of_platform_populate()
> and suppress stm32_timers_remove() which become useless.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> 
> CC: Lee Jones <lee.jones@linaro.org>
> CC: Alexandre Torgue <alexandre.torgue@st.com>
> CC: linux-arm-kernel@lists.infradead.org
> CC: linux-kernel@vger.kernel.org
> ---
>  drivers/mfd/stm32-timers.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/stm32-timers.c b/drivers/mfd/stm32-timers.c
> index 2182f00..a6675a4 100644
> --- a/drivers/mfd/stm32-timers.c
> +++ b/drivers/mfd/stm32-timers.c
> @@ -58,14 +58,7 @@ static int stm32_timers_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, ddata);
>  
> -	return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
> -}
> -
> -static int stm32_timers_remove(struct platform_device *pdev)
> -{
> -	of_platform_depopulate(&pdev->dev);
> -
> -	return 0;
> +	return devm_of_platform_populate(&pdev->dev);
>  }
>  
>  static const struct of_device_id stm32_timers_of_match[] = {
> @@ -76,7 +69,6 @@ static int stm32_timers_remove(struct platform_device *pdev)
>  
>  static struct platform_driver stm32_timers_driver = {
>  	.probe = stm32_timers_probe,
> -	.remove = stm32_timers_remove,
>  	.driver	= {
>  		.name = "stm32-timers",
>  		.of_match_table = stm32_timers_of_match,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1652620 — [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()

FromBenjamin Gaignard <benjamin.gaignard@linaro.org>
Date2017-05-29 17:50 +0200
Subject[PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()
Message-ID<tMv5F-1UR-33@gated-at.bofh.it>
In reply to#1652605
Usage of  devm_of_platform_populate() simplify driver code
by allowing to delete cpcap_remove().

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

CC: Lee Jones <lee.jones@linaro.org>
CC: linux-kernel@vger.kernel.org
---
 drivers/mfd/motorola-cpcap.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
index 3cab58a..d2cc1ea 100644
--- a/drivers/mfd/motorola-cpcap.c
+++ b/drivers/mfd/motorola-cpcap.c
@@ -260,17 +260,7 @@ static int cpcap_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
-	return of_platform_populate(spi->dev.of_node, NULL, NULL,
-				    &cpcap->spi->dev);
-}
-
-static int cpcap_remove(struct spi_device *pdev)
-{
-	struct cpcap_ddata *cpcap = spi_get_drvdata(pdev);
-
-	of_platform_depopulate(&cpcap->spi->dev);
-
-	return 0;
+	return devm_of_platform_populate(&cpcap->spi->dev);
 }
 
 static struct spi_driver cpcap_driver = {
@@ -279,7 +269,6 @@ static int cpcap_remove(struct spi_device *pdev)
 		.of_match_table = cpcap_of_match,
 	},
 	.probe = cpcap_probe,
-	.remove = cpcap_remove,
 };
 module_spi_driver(cpcap_driver);
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1652731 — Re: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-05-30 00:10 +0200
SubjectRe: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()
Message-ID<tMB1o-6md-9@gated-at.bofh.it>
In reply to#1652620
On Mon, May 29, 2017 at 6:45 PM, Benjamin Gaignard
<benjamin.gaignard@linaro.org> wrote:
> Usage of  devm_of_platform_populate() simplify driver code
> by allowing to delete cpcap_remove().

> -       .remove = cpcap_remove,

Can you remove module after that change?

-- 
With Best Regards,
Andy Shevchenko

[toc] | [prev] | [next] | [standalone]


#1652891 — Re: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()

FromBenjamin Gaignard <benjamin.gaignard@linaro.org>
Date2017-05-30 09:30 +0200
SubjectRe: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()
Message-ID<tMJLk-4dg-9@gated-at.bofh.it>
In reply to#1652731
2017-05-30 0:07 GMT+02:00 Andy Shevchenko <andy.shevchenko@gmail.com>:
> On Mon, May 29, 2017 at 6:45 PM, Benjamin Gaignard
> <benjamin.gaignard@linaro.org> wrote:
>> Usage of  devm_of_platform_populate() simplify driver code
>> by allowing to delete cpcap_remove().
>
>> -       .remove = cpcap_remove,
>
> Can you remove module after that change?

yes you can, it will be done by driver default function and
of_platform_depopulate() will be called after

>
> --
> With Best Regards,
> Andy Shevchenko

[toc] | [prev] | [next] | [standalone]


#1653068 — Re: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()

FromLee Jones <lee.jones@linaro.org>
Date2017-05-30 12:10 +0200
SubjectRe: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()
Message-ID<tMMga-5Z0-13@gated-at.bofh.it>
In reply to#1652731
On Tue, 30 May 2017, Andy Shevchenko wrote:

> On Mon, May 29, 2017 at 6:45 PM, Benjamin Gaignard
> <benjamin.gaignard@linaro.org> wrote:
> > Usage of  devm_of_platform_populate() simplify driver code
> > by allowing to delete cpcap_remove().
> 
> > -       .remove = cpcap_remove,
> 
> Can you remove module after that change?

Why wouldn't you?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1653101 — Re: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-05-30 12:50 +0200
SubjectRe: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()
Message-ID<tMMSR-6dU-11@gated-at.bofh.it>
In reply to#1653068
On Tue, May 30, 2017 at 1:03 PM, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, 30 May 2017, Andy Shevchenko wrote:
>
>> On Mon, May 29, 2017 at 6:45 PM, Benjamin Gaignard
>> <benjamin.gaignard@linaro.org> wrote:
>> > Usage of  devm_of_platform_populate() simplify driver code
>> > by allowing to delete cpcap_remove().
>>
>> > -       .remove = cpcap_remove,
>>
>> Can you remove module after that change?
>
> Why wouldn't you?

Indeed.
Just checked __device_release_driver().

-- 
With Best Regards,
Andy Shevchenko

[toc] | [prev] | [next] | [standalone]


#1652622 — [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate()

FromBenjamin Gaignard <benjamin.gaignard@linaro.org>
Date2017-05-29 17:50 +0200
Subject[PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate()
Message-ID<tMv5F-1UR-39@gated-at.bofh.it>
In reply to#1652605
Use devm_of_platform_populate() instead of of_platform_populate and
of_platform_depopulate to simplify driver code

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

CC: Jonathan Cameron <jic23@kernel.org>
CC: Hartmut Knaack <knaack.h@gmx.de>
CC: Lars-Peter Clausen <lars@metafoo.de>
CC: Alexandre Torgue <alexandre.torgue@st.com>
CC: Fabrice Gasnier <fabrice.gasnier@st.com>
CC: linux-iio@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: linux-kernel@vger.kernel.org
---
 drivers/iio/adc/stm32-adc-core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
index 22b7c93..46e41dc5 100644
--- a/drivers/iio/adc/stm32-adc-core.c
+++ b/drivers/iio/adc/stm32-adc-core.c
@@ -186,7 +186,6 @@ static void stm32_adc_irq_remove(struct platform_device *pdev,
 static int stm32_adc_probe(struct platform_device *pdev)
 {
 	struct stm32_adc_priv *priv;
-	struct device_node *np = pdev->dev.of_node;
 	struct resource *res;
 	int ret;
 
@@ -249,7 +248,7 @@ static int stm32_adc_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, &priv->common);
 
-	ret = of_platform_populate(np, NULL, NULL, &pdev->dev);
+	ret = devm_of_platform_populate(&pdev->dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to populate DT children\n");
 		goto err_irq_remove;
@@ -274,7 +273,6 @@ static int stm32_adc_remove(struct platform_device *pdev)
 	struct stm32_adc_common *common = platform_get_drvdata(pdev);
 	struct stm32_adc_priv *priv = to_stm32_adc_priv(common);
 
-	of_platform_depopulate(&pdev->dev);
 	stm32_adc_irq_remove(pdev, priv);
 	clk_disable_unprepare(priv->aclk);
 	regulator_disable(priv->vref);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1652625 — Re: [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate()

FromFabrice Gasnier <fabrice.gasnier@st.com>
Date2017-05-29 18:10 +0200
SubjectRe: [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate()
Message-ID<tMvoZ-2iD-3@gated-at.bofh.it>
In reply to#1652622
On 05/29/2017 05:45 PM, Benjamin Gaignard wrote:
> Use devm_of_platform_populate() instead of of_platform_populate and
> of_platform_depopulate to simplify driver code
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> 
> CC: Jonathan Cameron <jic23@kernel.org>
> CC: Hartmut Knaack <knaack.h@gmx.de>
> CC: Lars-Peter Clausen <lars@metafoo.de>
> CC: Alexandre Torgue <alexandre.torgue@st.com>
> CC: Fabrice Gasnier <fabrice.gasnier@st.com>
> CC: linux-iio@vger.kernel.org
> CC: linux-arm-kernel@lists.infradead.org
> CC: linux-kernel@vger.kernel.org
> ---
>  drivers/iio/adc/stm32-adc-core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
> index 22b7c93..46e41dc5 100644
> --- a/drivers/iio/adc/stm32-adc-core.c
> +++ b/drivers/iio/adc/stm32-adc-core.c
> @@ -186,7 +186,6 @@ static void stm32_adc_irq_remove(struct platform_device *pdev,
>  static int stm32_adc_probe(struct platform_device *pdev)
>  {
>  	struct stm32_adc_priv *priv;
> -	struct device_node *np = pdev->dev.of_node;
>  	struct resource *res;
>  	int ret;
>  
> @@ -249,7 +248,7 @@ static int stm32_adc_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, &priv->common);
>  
> -	ret = of_platform_populate(np, NULL, NULL, &pdev->dev);
> +	ret = devm_of_platform_populate(&pdev->dev);
>  	if (ret < 0) {
>  		dev_err(&pdev->dev, "failed to populate DT children\n");
>  		goto err_irq_remove;
> @@ -274,7 +273,6 @@ static int stm32_adc_remove(struct platform_device *pdev)
>  	struct stm32_adc_common *common = platform_get_drvdata(pdev);
>  	struct stm32_adc_priv *priv = to_stm32_adc_priv(common);
>  
> -	of_platform_depopulate(&pdev->dev);

Hi Benjamin,

This is going to change order of sub devices removal. It may end-up with
bellow resources being removed while sub-device still needs them.
Not sure this is a good candidate for such a change.

Best Regards,
Fabrice

>  	stm32_adc_irq_remove(pdev, priv);
>  	clk_disable_unprepare(priv->aclk);
>  	regulator_disable(priv->vref);
> 

[toc] | [prev] | [next] | [standalone]


#1652629 — Re: [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate()

FromJonathan Cameron <jic23@kernel.org>
Date2017-05-29 18:10 +0200
SubjectRe: [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate()
Message-ID<tMvp0-2iD-21@gated-at.bofh.it>
In reply to#1652622
On Mon, 29 May 2017 17:45:49 +0200
Benjamin Gaignard <benjamin.gaignard@linaro.org> wrote:

> Use devm_of_platform_populate() instead of of_platform_populate and
> of_platform_depopulate to simplify driver code
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
My gut feeling is to dislike this particular instance.

It's changing the order of removal of elements to not
be a reverse of the order of them being set up.  That
takes it from obviously correct to something where some thought
is required.  For the trivial saving in lines of code I'm
unconvinced it is a worthwhile change..

Mind you, this particular driver isn't balancing the
probe and remove order anyway (the regulator stuff)
so I guess it's not making it much worse...

Jonathan
> 
> CC: Jonathan Cameron <jic23@kernel.org>
> CC: Hartmut Knaack <knaack.h@gmx.de>
> CC: Lars-Peter Clausen <lars@metafoo.de>
> CC: Alexandre Torgue <alexandre.torgue@st.com>
> CC: Fabrice Gasnier <fabrice.gasnier@st.com>
> CC: linux-iio@vger.kernel.org
> CC: linux-arm-kernel@lists.infradead.org
> CC: linux-kernel@vger.kernel.org
> ---
>  drivers/iio/adc/stm32-adc-core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
> index 22b7c93..46e41dc5 100644
> --- a/drivers/iio/adc/stm32-adc-core.c
> +++ b/drivers/iio/adc/stm32-adc-core.c
> @@ -186,7 +186,6 @@ static void stm32_adc_irq_remove(struct platform_device *pdev,
>  static int stm32_adc_probe(struct platform_device *pdev)
>  {
>  	struct stm32_adc_priv *priv;
> -	struct device_node *np = pdev->dev.of_node;
>  	struct resource *res;
>  	int ret;
>  
> @@ -249,7 +248,7 @@ static int stm32_adc_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, &priv->common);
>  
> -	ret = of_platform_populate(np, NULL, NULL, &pdev->dev);
> +	ret = devm_of_platform_populate(&pdev->dev);
>  	if (ret < 0) {
>  		dev_err(&pdev->dev, "failed to populate DT children\n");
>  		goto err_irq_remove;
> @@ -274,7 +273,6 @@ static int stm32_adc_remove(struct platform_device *pdev)
>  	struct stm32_adc_common *common = platform_get_drvdata(pdev);
>  	struct stm32_adc_priv *priv = to_stm32_adc_priv(common);
>  
> -	of_platform_depopulate(&pdev->dev);
>  	stm32_adc_irq_remove(pdev, priv);
>  	clk_disable_unprepare(priv->aclk);
>  	regulator_disable(priv->vref);

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web