[alsa-devel] [PATCH 00/15] make more driver use devm_of_platform_populate()
Number of calls to of_platform_populate() aren't unbalanced by a call to of_platform_depopulate() that could generate issue will loading/unloading the drivers. Make those drivers use devm_of_platform_populate() fix the problem without need to add remove function.
In some case replacing of_platform_populate() by devm_of_platform_populate() allow to delete driver remove function and save some lines of code.
This series of patches based on v4.12-rc3 tag.
CC: Alexandre Torgue alexandre.torgue@st.com CC: David Airlie airlied@linux.ie CC: Fabrice Gasnier fabrice.gasnier@st.com CC: Hartmut Knaack knaack.h@gmx.de CC: Jaroslav Kysela perex@perex.cz CC: Javier Martinez Canillas javier@osg.samsung.com CC: Jonathan Cameron jic23@kernel.org CC: Krzysztof Kozlowski krzk@kernel.org CC: Kukjin Kim kgene@kernel.org CC: Kyungmin Park kyungmin.park@samsung.com CC: Lars-Peter Clausen lars@metafoo.de CC: Lee Jones lee.jones@linaro.org CC: Liam Girdwood lgirdwood@gmail.com CC: Mark Brown broonie@kernel.org CC: Mauro Carvalho Chehab mchehab@kernel.org CC: Olivier Moysan olivier.moysan@st.com CC: Rob Clark robdclark@gmail.com CC: Shawn Guo shawnguo@kernel.org CC: Sylwester Nawrocki s.nawrocki@samsung.com CC: Takashi Iwai tiwai@suse.com CC: Tony Lindgren tony@atomide.com
CC: linux-iio@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org CC: linux-kernel@vger.kernel.org CC: dri-devel@lists.freedesktop.org CC: linux-arm-msm@vger.kernel.org CC: freedreno@lists.freedesktop.org CC: linux-samsung-soc@vger.kernel.org CC: alsa-devel@alsa-project.org CC: linux-media@vger.kernel.org
Benjamin Gaignard (15): iio: adc: stm32: use devm_of_platform_populate() iio: dac: stm32: use devm_of_platform_populate() drm: zte: use devm_of_platform_populate() drm: msm: use devm_of_platform_populate() mfd: stm32-timers: use devm_of_platform_populate mfd: atmel: use devm_of_platform_populate() mfd: cros_ec: use devm_of_platform_populate() mfd: exynos: use devm_of_platform_populate() mfd: fsl-imx25: use devm_of_platform_populate() mfd: motorola-cpcap: use devm_of_platform_populate() mfd: palmas: use devm_of_platform_populate() mfd: qcom-spmi-pmic: use devm_of_platform_populate() mfd: smsc-ece: use devm_of_platform_populate() sound: stm32: use devm_of_platform_populate() media: exynos4-is: use devm_of_platform_populate()
drivers/gpu/drm/msm/msm_drv.c | 10 ++-------- drivers/gpu/drm/zte/zx_drm_drv.c | 2 +- drivers/iio/adc/stm32-adc-core.c | 4 +--- drivers/iio/dac/stm32-dac-core.c | 3 +-- drivers/media/platform/exynos4-is/fimc-is.c | 7 ++----- drivers/mfd/atmel-flexcom.c | 2 +- drivers/mfd/cros_ec.c | 2 +- drivers/mfd/exynos-lpass.c | 2 +- drivers/mfd/fsl-imx25-tsadc.c | 5 +---- drivers/mfd/motorola-cpcap.c | 13 +------------ drivers/mfd/palmas.c | 2 +- drivers/mfd/qcom-spmi-pmic.c | 9 +-------- drivers/mfd/smsc-ece1099.c | 3 +-- drivers/mfd/stm32-timers.c | 10 +--------- sound/soc/stm/stm32_sai.c | 11 +---------- 15 files changed, 17 insertions(+), 68 deletions(-)
Usage of devm_of_platform_populate() simplify driver code by allowing to delete stm32_sai_remove().
Signed-off-by: Benjamin Gaignard benjamin.gaignard@linaro.org
CC: Liam Girdwood lgirdwood@gmail.com CC: Mark Brown broonie@kernel.org CC: Jaroslav Kysela perex@perex.cz CC: Takashi Iwai tiwai@suse.com CC: Alexandre Torgue alexandre.torgue@st.com CC: Olivier Moysan olivier.moysan@st.com CC: alsa-devel@alsa-project.org CC: linux-arm-kernel@lists.infradead.org CC: linux-kernel@vger.kernel.org --- sound/soc/stm/stm32_sai.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c index 2a27a26..25304f8 100644 --- a/sound/soc/stm/stm32_sai.c +++ b/sound/soc/stm/stm32_sai.c @@ -34,7 +34,6 @@
static int stm32_sai_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; struct stm32_sai_data *sai; struct reset_control *rst; struct resource *res; @@ -86,14 +85,7 @@ static int stm32_sai_probe(struct platform_device *pdev) sai->pdev = pdev; platform_set_drvdata(pdev, sai);
- return of_platform_populate(np, NULL, NULL, &pdev->dev); -} - -static int stm32_sai_remove(struct platform_device *pdev) -{ - of_platform_depopulate(&pdev->dev); - - return 0; + return devm_of_platform_populate(&pdev->dev); }
MODULE_DEVICE_TABLE(of, stm32_sai_ids); @@ -104,7 +96,6 @@ static int stm32_sai_remove(struct platform_device *pdev) .of_match_table = stm32_sai_ids, }, .probe = stm32_sai_probe, - .remove = stm32_sai_remove, };
module_platform_driver(stm32_sai_driver);
Acked-by: Olivier Moysan olivier.moysan@st.com
participants (2)
-
Benjamin Gaignard
-
Olivier MOYSAN