Commit 2fb0feed authored by Yong Wu's avatar Yong Wu Committed by Mauro Carvalho Chehab

media: iommu/mediatek: Return ENODEV if the device is NULL

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: default avatarYong Wu <yong.wu@mediatek.com>
Acked-by: default avatarJoerg Roedel <jroedel@suse.de>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 822a2ed8
...@@ -848,7 +848,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) ...@@ -848,7 +848,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
plarbdev = of_find_device_by_node(larbnode); plarbdev = of_find_device_by_node(larbnode);
if (!plarbdev) { if (!plarbdev) {
of_node_put(larbnode); of_node_put(larbnode);
return -EPROBE_DEFER; return -ENODEV;
} }
data->larb_imu[id].dev = &plarbdev->dev; data->larb_imu[id].dev = &plarbdev->dev;
......
...@@ -604,7 +604,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) ...@@ -604,7 +604,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
plarbdev = of_find_device_by_node(larbnode); plarbdev = of_find_device_by_node(larbnode);
if (!plarbdev) { if (!plarbdev) {
of_node_put(larbnode); of_node_put(larbnode);
return -EPROBE_DEFER; return -ENODEV;
} }
data->larb_imu[i].dev = &plarbdev->dev; data->larb_imu[i].dev = &plarbdev->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment