Commit e98153a8 authored by Li Zetao's avatar Li Zetao Committed by Daniel Lezcano

thermal/drivers/ti-soc-thermal: Use helper function IS_ERR_OR_NULL()

Use IS_ERR_OR_NULL() to detect an error pointer or a null pointer
open-coding to simplify the code.
Signed-off-by: default avatarLi Zetao <lizetao1@huawei.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230817014900.3094512-1-lizetao1@huawei.com
parent 01c2180b
...@@ -314,7 +314,7 @@ int ti_bandgap_adc_to_mcelsius(struct ti_bandgap *bgp, int adc_val, int *t) ...@@ -314,7 +314,7 @@ int ti_bandgap_adc_to_mcelsius(struct ti_bandgap *bgp, int adc_val, int *t)
*/ */
static inline int ti_bandgap_validate(struct ti_bandgap *bgp, int id) static inline int ti_bandgap_validate(struct ti_bandgap *bgp, int id)
{ {
if (!bgp || IS_ERR(bgp)) { if (IS_ERR_OR_NULL(bgp)) {
pr_err("%s: invalid bandgap pointer\n", __func__); pr_err("%s: invalid bandgap pointer\n", __func__);
return -EINVAL; return -EINVAL;
} }
......
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