[PATCH 02/15] iio: dac: stm32: use devm_of_platform_populate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

CC: Jonathan Cameron <jic23@xxxxxxxxxx>
CC: Hartmut Knaack <knaack.h@xxxxxx>
CC: Lars-Peter Clausen <lars@xxxxxxxxxx>
CC: Alexandre Torgue <alexandre.torgue@xxxxxx>
CC: Fabrice Gasnier <fabrice.gasnier@xxxxxx>
CC: linux-iio@xxxxxxxxxxxxxxx
CC: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
---
 drivers/iio/dac/stm32-dac-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c
index 75e4878..9c42537 100644
--- a/drivers/iio/dac/stm32-dac-core.c
+++ b/drivers/iio/dac/stm32-dac-core.c
@@ -130,7 +130,7 @@ static int stm32_dac_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, &priv->common);
 
-	ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, dev);
+	ret = devm_of_platform_populate(&pdev->dev);
 	if (ret < 0) {
 		dev_err(dev, "failed to populate DT children\n");
 		goto err_pclk;
@@ -151,7 +151,6 @@ static int stm32_dac_remove(struct platform_device *pdev)
 	struct stm32_dac_common *common = platform_get_drvdata(pdev);
 	struct stm32_dac_priv *priv = to_stm32_dac_priv(common);
 
-	of_platform_depopulate(&pdev->dev);
 	clk_disable_unprepare(priv->pclk);
 	regulator_disable(priv->vref);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux