Skip to content

Commit

Permalink
media: iommu/mediatek: Return ENODEV if the device is NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yong Wu authored and Mauro Carvalho Chehab committed Jan 28, 2022
1 parent 822a2ed commit 2fb0fee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/iommu/mtk_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/iommu/mtk_iommu_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2fb0fee

Please sign in to comment.