mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
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: e54a52a28a ("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
This commit is contained in:
parent
e54a52a28a
commit
7fdd04e15a
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user