[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220821151713.11198-2-W_Armin@gmx.de>
Date: Sun, 21 Aug 2022 17:17:11 +0200
From: Armin Wolf <W_Armin@....de>
To: pali@...nel.org
Cc: jdelvare@...e.com, linux@...ck-us.net, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] hwmon: (dell-smm) Fail probing when cooling device registration fails
Previously, it was thought that failing to register a cooling device
would not be critical, so the probing was not aborted in such a case.
This however would lead to userspace being unable to rely on those
cooling devices, since they might not represent all fans being present.
Fix that by failing probing when cooling device registration fails.
Tested on a Dell Inspiron 3505.
Fixes: e0d3f7cb2606 ("hwmon: (dell-smm) Add cooling device support")
Signed-off-by: Armin Wolf <W_Armin@....de>
---
drivers/hwmon/dell-smm-hwmon.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index 7f8d95dd2717..1dab7591576a 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -1013,12 +1013,10 @@ static int __init dell_smm_init_hwmon(struct device *dev)
data->fan[i] = true;
- /* the cooling device is not critical, ignore failures */
if (IS_REACHABLE(CONFIG_THERMAL)) {
err = dell_smm_init_cdev(dev, i);
if (err < 0)
- dev_warn(dev, "Failed to register cooling device for fan %u\n",
- i + 1);
+ return err;
}
data->fan_nominal_speed[i] = devm_kmalloc_array(dev, data->i8k_fan_max + 1,
--
2.30.2
Powered by blists - more mailing lists