summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorMinjie Du <duminjie@vivo.com>2023-09-21 17:10:50 +0800
committerDaniel Lezcano <daniel.lezcano@linaro.org>2023-10-15 23:40:10 +0200
commit2ffa39c83b39f555d9a61daec3ed1cc79c4ba7ef (patch)
tree6e321b0e8f9825ced81a3269674341b73ee2d969 /drivers/thermal
parentde84da588f35423c5c2e6a46f2bc8a07f8eaf793 (diff)
thermal/drivers/mediatek/lvts_thermal: Fix error check in lvts_debugfs_init()
debugfs_create_dir() function returns an error value embedded in the pointer (PTR_ERR). Evaluate the return value using IS_ERR rather than checking for NULL. Signed-off-by: Minjie Du <duminjie@vivo.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230921091057.3812-1-duminjie@vivo.com
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/mediatek/lvts_thermal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index f1feaa1ace2e..704b22d12e27 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -219,7 +219,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td)
sprintf(name, "controller%d", i);
dentry = debugfs_create_dir(name, lvts_td->dom_dentry);
- if (!dentry)
+ if (IS_ERR(dentry))
continue;
regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL);