Skip to content

Commit e98153a

Browse files
Li Zetaodlezcano
authored andcommitted
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 <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 01c2180 commit e98153a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thermal/ti-soc-thermal/ti-bandgap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ int ti_bandgap_adc_to_mcelsius(struct ti_bandgap *bgp, int adc_val, int *t)
314314
*/
315315
static inline int ti_bandgap_validate(struct ti_bandgap *bgp, int id)
316316
{
317-
if (!bgp || IS_ERR(bgp)) {
317+
if (IS_ERR_OR_NULL(bgp)) {
318318
pr_err("%s: invalid bandgap pointer\n", __func__);
319319
return -EINVAL;
320320
}

0 commit comments

Comments
 (0)