summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-03-02 13:10:27 +0300
committerJoerg Roedel <jroedel@suse.de>2016-03-02 15:49:21 +0100
commit3189e4905c2d08d6618d79af2c486f530bbfb3b4 (patch)
treeacf8cca54769ccff453bbce6494b07520b9fecf6 /drivers/iommu
parent0b6c0ad3cfe6bc914af3ae595c9729e38f11a024 (diff)
iommu/mediatek: Check for NULL instead of IS_ERR()
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>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/mtk_iommu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index 4b9ae64c2fc3..929a66a81b2b 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -627,7 +627,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
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;
@@ -720,8 +720,8 @@ static int mtk_iommu_init_fn(struct device_node *np)
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) {