diff mbox series

[1/2] media: samsung: exynos4-is: drop simple-bus from compatibles

Message ID 20230207192914.549309-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State New, archived
Headers show
Series [1/2] media: samsung: exynos4-is: drop simple-bus from compatibles | expand

Commit Message

Krzysztof Kozlowski Feb. 7, 2023, 7:29 p.m. UTC
The FIMC camera node wrapper is not a bus, so using simple-bus fallback
compatible just to instantiate its children nodes was never correct.
Driver should explicitly populate all its children devices.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/media/platform/samsung/exynos4-is/media-dev.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Krzysztof Kozlowski Feb. 7, 2023, 8:15 p.m. UTC | #1
On 07/02/2023 20:29, Krzysztof Kozlowski wrote:
> The FIMC camera node wrapper is not a bus, so using simple-bus fallback
> compatible just to instantiate its children nodes was never correct.
> Driver should explicitly populate all its children devices.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/media/platform/samsung/exynos4-is/media-dev.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c
> index 98a60f01129d..70c4ca7844d3 100644
> --- a/drivers/media/platform/samsung/exynos4-is/media-dev.c
> +++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c
> @@ -1440,6 +1440,10 @@ static int fimc_md_probe(struct platform_device *pdev)
>  	if (!fmd)
>  		return -ENOMEM;
>  
> +	ret = devm_of_platform_populate(dev);
> +	if (ret < 0)
> +		return -ENOMEM;
> +

This cannot be devm-like, because on errors unpopulating devices breaks
links and IOMMU. I will make it of_platform_populate() instead.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c
index 98a60f01129d..70c4ca7844d3 100644
--- a/drivers/media/platform/samsung/exynos4-is/media-dev.c
+++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c
@@ -1440,6 +1440,10 @@  static int fimc_md_probe(struct platform_device *pdev)
 	if (!fmd)
 		return -ENOMEM;
 
+	ret = devm_of_platform_populate(dev);
+	if (ret < 0)
+		return -ENOMEM;
+
 	spin_lock_init(&fmd->slock);
 	INIT_LIST_HEAD(&fmd->pipelines);
 	fmd->pdev = pdev;