[PATCH] thermal/drivers/ti-soc: Use IS_ERR_OR_NULL() to simplify code

Liao Yuanhong posted 1 patch 1 month, 3 weeks ago
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] thermal/drivers/ti-soc: Use IS_ERR_OR_NULL() to simplify code
Posted by Liao Yuanhong 1 month, 3 weeks ago
Use IS_ERR_OR_NULL() instead of the original !xxx || IS_ERR(xxx) logic.
This will simplify the code and enhance readability.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0cf0826b805a..9218417e6d92 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -228,7 +228,7 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
 		return 0;
 
 	data = ti_bandgap_get_sensor_data(bgp, id);
-	if (!data || IS_ERR(data))
+	if (IS_ERR_OR_NULL(data))
 		data = ti_thermal_build_data(bgp, id);
 
 	if (!data)
-- 
2.34.1