]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: iommu/mediatek: Return ENODEV if the device is NULL
authorYong Wu <yong.wu@mediatek.com>
Mon, 17 Jan 2022 07:05:00 +0000 (08:05 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:39:51 +0000 (14:39 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 2fb0feed51085db77606de9b9477c96894328809 ]

The platform device is created at:
of_platform_default_populate_init:  arch_initcall_sync
  ->of_platform_populate
        ->of_platform_device_create_pdata

When entering our probe, all the devices should be already created.
if it is null, means NODEV. Currently we don't get the fail case.
It's a minor fix, no need add fixes tags.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 4dd3e2d1bd70d6ada8d201613497c8d8abe8185f)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/iommu/mtk_iommu.c
drivers/iommu/mtk_iommu_v1.c

index 25b834104790cd97f111ac7f934365aa6695bc62..77ae20ff9b35676ddc0d20b4000a055f6c04cb3f 100644 (file)
@@ -848,7 +848,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
                plarbdev = of_find_device_by_node(larbnode);
                if (!plarbdev) {
                        of_node_put(larbnode);
-                       return -EPROBE_DEFER;
+                       return -ENODEV;
                }
                data->larb_imu[id].dev = &plarbdev->dev;
 
index 1467ba1e4417ccd90e4371e585dbddc0130e0ac4..68bf02f87cfd198277daa7415c47aa9856fff809 100644 (file)
@@ -604,7 +604,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
                plarbdev = of_find_device_by_node(larbnode);
                if (!plarbdev) {
                        of_node_put(larbnode);
-                       return -EPROBE_DEFER;
+                       return -ENODEV;
                }
                data->larb_imu[i].dev = &plarbdev->dev;