[PATCH linux dev-4.10 v2 2/3] max31785: Support use-stored-presence devicetree property

Andrew Jeffery andrew at aj.id.au
Tue Aug 1 13:19:31 AEST 2017


Allows fans to be marked as installed to reflect the devicetree, or not.

Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
 drivers/hwmon/pmbus/max31785.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/pmbus/max31785.c b/drivers/hwmon/pmbus/max31785.c
index 1c2648ce5322..c2b693badcea 100644
--- a/drivers/hwmon/pmbus/max31785.c
+++ b/drivers/hwmon/pmbus/max31785.c
@@ -270,9 +270,12 @@ static int max31785_of_fan_config(struct i2c_client *client,
 	if (pb_cfg < 0)
 		return pb_cfg;
 
-	if (!(pb_cfg & PB_FAN_1_INSTALLED)) {
-		dev_warn(dev, "Fan %d is configured but not installed\n", page);
-		return 0;
+	if (of_property_read_bool(child->parent, "use-stored-presence")) {
+		if (!(pb_cfg & PB_FAN_1_INSTALLED))
+			dev_info(dev, "Fan %d is configured but not installed\n",
+				 page);
+	} else {
+		pb_cfg |= PB_FAN_1_INSTALLED;
 	}
 
 	ret = of_property_read_string(child, "maxim,fan-rotor-input", &sval);
-- 
2.11.0



More information about the openbmc mailing list