[PATCH 04/12] regulator: max8973: Remove redundant error log prints
From: Xichao Zhao
Date: Fri Sep 05 2025 - 03:29:48 EST
devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.
Signed-off-by: Xichao Zhao <zhao.xichao@xxxxxxxx>
---
drivers/regulator/max8973-regulator.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index f68caa07f546..9853a7a5850b 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -478,12 +478,8 @@ static int max8973_thermal_init(struct max8973_chip *mchip)
tzd = devm_thermal_of_zone_register(mchip->dev, 0, mchip,
&max77621_tz_ops);
- if (IS_ERR(tzd)) {
- ret = PTR_ERR(tzd);
- dev_err(mchip->dev, "Failed to register thermal sensor: %d\n",
- ret);
- return ret;
- }
+ if (IS_ERR(tzd))
+ return PTR_ERR(tzd);
if (mchip->irq <= 0)
return 0;
--
2.34.1