Skip to contentSkip to conversation

drivers: hwmon: max31827: handle vref regulator

PATCH Superseded Antoniu Miclaus 2 participants 2 messages Sep 25, 2023 Hardware monitoring

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drivers: hwmon: max31827: handle vref regulator

Add missing implementation for the max31827 supply regulator. This is a hardware required property that is not handled.

---
changes in v3:
- revert also the dev_err_probe output to use "vref" instead of "vdd".

 drivers/hwmon/max31827.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwmon/max31827.c +5 -0
index 602f4e4f81ff..2a61fb9a408a 100644
@@ -427,6 +427,11 @@ static int max31827_probe(struct i2c_client *client)
 		return dev_err_probe(dev, PTR_ERR(st->regmap),
 				     "Failed to allocate regmap.\n");
 
+	err = devm_regulator_get_enable(dev, "vref");
+	if (err)
+		return dev_err_probe(dev, err,
+				     "failed to enable vref regulator\n");
+
 	err = max31827_init_client(st);
 	if (err)
 		return err;
Signature · 1 line
2.42.0
maintainer
#1 lore raw
Quoted 15 lines · Antoniu Miclaus

Add missing implementation for the max31827 supply regulator. This is a hardware required property that is not handled.

---
changes in v3:
- revert also the dev_err_probe output to use "vref" instead of "vdd".

 drivers/hwmon/max31827.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwmon/max31827.c +0 -0
index 602f4e4f81ff..2a61fb9a408a 100644

drivers/hwmon/max31827.c static int max31827_probe(struct i2c_client *client) · line 433

Quoted 7 lines
drivers/hwmon/max31827.c +4 -0
@@ -427,6 +427,11 @@ static int max31827_probe(struct i2c_client *client)
 		return dev_err_probe(dev, PTR_ERR(st->regmap),
 				     "Failed to allocate regmap.\n");
 
+	err = devm_regulator_get_enable(dev, "vref");
+	if (err)
+		return dev_err_probe(dev, err,
+				     "failed to enable vref regulator\n");

Please drop the "vref". "failed to enable regulator" is sufficient.

Guenter

Quoted 7 lines
drivers/hwmon/max31827.c +1 -0
+
 	err = max31827_init_client(st);
 	if (err)
 		return err;
Signature · 1 line
2.42.0