of_platform_device_create() returns NULL on error, it never returns
error pointers.
Fixes: 0df4fabe208d ('iommu/mediatek: Add mt8173 IOMMU driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
plarbdev = of_platform_device_create(
larbnode, NULL,
platform_bus_type.dev_root);
- if (IS_ERR(plarbdev))
+ if (!plarbdev)
return -EPROBE_DEFER;
}
data->smi_imu.larb_imu[i].dev = &plarbdev->dev;
struct platform_device *pdev;
pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
- if (IS_ERR(pdev))
- return PTR_ERR(pdev);
+ if (!pdev)
+ return -ENOMEM;
ret = platform_driver_register(&mtk_iommu_driver);
if (ret) {