Skip to content

Commit

Permalink
thermal/drivers/ti-soc-thermal: Use helper function IS_ERR_OR_NULL()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Li Zetao authored and Daniel Lezcano committed Aug 17, 2023
1 parent 01c2180 commit e98153a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/thermal/ti-soc-thermal/ti-bandgap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e98153a

Please sign in to comment.