summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorLi Zetao <lizetao1@huawei.com>2023-08-17 04:49:00 +0300
committerDaniel Lezcano <daniel.lezcano@linaro.org>2023-08-17 10:24:54 +0300
commite98153a8c60a91b54fe9193bb9d51080f948e7c1 (patch)
treef78e1affebc209515d2f9fc2e042f0c60c32e0b6 /drivers/thermal
parent01c2180b7099aac7902472a2204562397592782f (diff)
downloadlinux-e98153a8c60a91b54fe9193bb9d51080f948e7c1.tar.xz
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: Li Zetao <lizetao1@huawei.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230817014900.3094512-1-lizetao1@huawei.com
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/ti-soc-thermal/ti-bandgap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index a1c9a1530183..0c2eb9c6e58b 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -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)
{
- if (!bgp || IS_ERR(bgp)) {
+ if (IS_ERR_OR_NULL(bgp)) {
pr_err("%s: invalid bandgap pointer\n", __func__);
return -EINVAL;
}