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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:59 +0000 (14:23 +0200)
commit4dd3e2d1bd70d6ada8d201613497c8d8abe8185f
treea7a8863bab926a4f8937951a8266b16d3da82330
parent1515d141496747c6c4b706ab6a8360e8ba90294d
media: iommu/mediatek: Return ENODEV if the device is NULL

[ 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>
drivers/iommu/mtk_iommu.c
drivers/iommu/mtk_iommu_v1.c