summaryrefslogtreecommitdiff
path: root/drivers/powercap
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-06-06 11:22:42 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-06-12 19:51:21 +0200
commit49776c712eb6ded12fcbb8cc915a498dbfb47311 (patch)
tree3f929025c93859e6a3d430451ac64c78ef6062a8 /drivers/powercap
parent4658fe81b3f8afe8adf37734ec5fe595d90415c6 (diff)
powercap: RAPL: Fix a NULL vs IS_ERR() bug
The devm_ioremap_resource() function returns error pointers on error, it never returns NULL. Update the check accordingly. Fixes: 9eef7f9da928 ("powercap: intel_rapl: Introduce RAPL TPMI interface driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/powercap')
-rw-r--r--drivers/powercap/intel_rapl_tpmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/powercap/intel_rapl_tpmi.c b/drivers/powercap/intel_rapl_tpmi.c
index c016127b3497..4f4f13ded225 100644
--- a/drivers/powercap/intel_rapl_tpmi.c
+++ b/drivers/powercap/intel_rapl_tpmi.c
@@ -255,8 +255,8 @@ static int intel_rapl_tpmi_probe(struct auxiliary_device *auxdev,
}
trp->base = devm_ioremap_resource(&auxdev->dev, res);
- if (!trp->base) {
- ret = -ENOMEM;
+ if (IS_ERR(trp->base)) {
+ ret = PTR_ERR(trp->base);
goto err;
}