提交 c88a15d9 编写于 作者: Y Yang Yingliang 提交者: Suzuki K Poulose

coresight: tpda: fix return value check in tpda_probe()

devm_ioremap_resource() never returns NULL pointer, it
will return ERR_PTR() when it fails, so replace the check
with IS_ERR().

Fixes: 5b791662 ("Coresight: Add TPDA link driver")
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
[ Fix return value to the PTR_ERR(base) ]
Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230129084246.537694-1-yangyingliang@huawei.com
上级 0c1ccc15
...@@ -145,8 +145,8 @@ static int tpda_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -145,8 +145,8 @@ static int tpda_probe(struct amba_device *adev, const struct amba_id *id)
dev_set_drvdata(dev, drvdata); dev_set_drvdata(dev, drvdata);
base = devm_ioremap_resource(dev, &adev->res); base = devm_ioremap_resource(dev, &adev->res);
if (!base) if (IS_ERR(base))
return -ENOMEM; return PTR_ERR(base);
drvdata->base = base; drvdata->base = base;
spin_lock_init(&drvdata->spinlock); spin_lock_init(&drvdata->spinlock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册