Commit f8f706ad authored by Dan Carpenter's avatar Dan Carpenter Committed by Rafael J. Wysocki

powercap/drivers/dtpm: Fix an IS_ERR() vs NULL check

The powercap_register_control_type() function never returns NULL, it
returns error pointers on error so update this check.

Fixes: a20d0ef9 ("powercap/drivers/dtpm: Add API for dynamic thermal power management")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0fe1329b
......@@ -467,9 +467,9 @@ static int __init dtpm_init(void)
struct dtpm_descr **dtpm_descr;
pct = powercap_register_control_type(NULL, "dtpm", NULL);
if (!pct) {
if (IS_ERR(pct)) {
pr_err("Failed to register control type\n");
return -EINVAL;
return PTR_ERR(pct);
}
for_each_dtpm_table(dtpm_descr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment