diff options
| author | Dan Carpenter <dan.carpenter@linaro.org> | 2025-07-16 14:38:30 -0500 |
|---|---|---|
| committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2025-09-23 14:13:27 +0100 |
| commit | 7fdd04e15ad79cc2294b9e722d6282357da0b53a (patch) | |
| tree | 1d0ba28c32ca9c998d854f0dacb38cc60687da48 | |
| parent | e54a52a28a362cb3a88d7996558f547666ee79e7 (diff) | |
coresight: tnoc: Fix a NULL vs IS_ERR() bug in probe
The devm_ioremap_resource() function returns error pointers on error.
It never returns NULL. Update the error checking to match.
Fixes: e54a52a28a36 ("coresight: add coresight Trace Network On Chip driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/7bd9fae8-a15f-412a-8800-ce47acf0b5ce@sabinyo.mountain
| -rw-r--r-- | drivers/hwtracing/coresight/coresight-tnoc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwtracing/coresight/coresight-tnoc.c b/drivers/hwtracing/coresight/coresight-tnoc.c index 0e4164707eea..d542df46ea39 100644 --- a/drivers/hwtracing/coresight/coresight-tnoc.c +++ b/drivers/hwtracing/coresight/coresight-tnoc.c @@ -183,8 +183,8 @@ static int trace_noc_probe(struct amba_device *adev, const struct amba_id *id) dev_set_drvdata(dev, drvdata); drvdata->base = devm_ioremap_resource(dev, &adev->res); - if (!drvdata->base) - return -ENOMEM; + if (IS_ERR(drvdata->base)) + return PTR_ERR(drvdata->base); spin_lock_init(&drvdata->spinlock); |
