coresight: tpda: fix return value check in tpda_probe()
PATCH 1/1 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().
--- drivers/hwtracing/coresight/coresight-tpda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-tpda.c +1 -1
@@ -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;
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Suzuki K Poulose
maintainerQuoted 3 lines · Yang Yingliang
devm_ioremap_resource()never returns NULL pointer, it will returnERR_PTR()when it fails, so replace the check withIS_ERR().
Thanks for the patch.
Quoted 12 lines
Fixes 5b7916625c01 ("Coresight: Add TPDA link driver")Signed-off-by Yang Yingliang <[email protected]>--- drivers/hwtracing/coresight/coresight-tpda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwtracing/coresight/coresight-tpda.c +0
-0
drivers/hwtracing/coresight/coresight-tpda.c static int tpda_probe(struct amba_device *adev, const struct amba_id *id) · line 149
Quoted 6 lines
drivers/hwtracing/coresight/coresight-tpda.c +1
-1@@ -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 ;
I have fixed this up to :
return PTR_ERR(base);
for consistency.
Thanks
Suzuki
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 27 lines · Suzuki K Poulose
Quoted 3 lines · Yang Yingliang
devm_ioremap_resource()never returns NULL pointer, it will returnERR_PTR()when it fails, so replace the check withIS_ERR().Thanks for the patch.
Quoted 12 lines
Fixes 5b7916625c01 ("Coresight: Add TPDA link driver")Signed-off-by Yang Yingliang <[email protected]>---
drivers/hwtracing/coresight/coresight-tpda.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwtracing/coresight/coresight-tpda.c +0
-0drivers/hwtracing/coresight/coresight-tpda.c static int tpda_probe(struct amba_device *adev, · line 149
Quoted 6 lines
drivers/hwtracing/coresight/coresight-tpda.c +1
-1@@ -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;I have fixed this up to :
Quoted 3 lines
return
PTR_ERR(base);for consistency.
Yes, it should be PTR_ERR().
Thanks,
Yang
Quoted 6 lines
Thanks
Suzuki.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel