[PATCH -next] coresight: tpda: fix return value check in tpda_probe()

Yang Yingliang yangyingliang at huawei.com
Sun Jan 29 00:42:46 PST 2023


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

Fixes: 5b7916625c01 ("Coresight: Add TPDA link driver")
Signed-off-by: Yang Yingliang <yangyingliang at huawei.com>
---
 drivers/hwtracing/coresight/coresight-tpda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtracing/coresight/coresight-tpda.c
index 19c25c9f6157..6313b12880e0 100644
--- a/drivers/hwtracing/coresight/coresight-tpda.c
+++ b/drivers/hwtracing/coresight/coresight-tpda.c
@@ -145,7 +145,7 @@ static int tpda_probe(struct amba_device *adev, const struct amba_id *id)
 	dev_set_drvdata(dev, drvdata);
 
 	base = devm_ioremap_resource(dev, &adev->res);
-	if (!base)
+	if (IS_ERR(base))
 		return -ENOMEM;
 	drvdata->base = base;
 
-- 
2.25.1




More information about the linux-arm-kernel mailing list