Skip to contentSkip to conversation

hwmon: (ads7828) Check return value of devm_regmap_init_i2c

PATCH Applied Axel Lin 2 participants 2 messages Feb 10, 2015 Hardware monitoring

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 hwmon: (ads7828) Check return value of devm_regmap_init_i2c

devm_regmap_init_i2c() can fail, thus add return value checking.

---
 drivers/hwmon/ads7828.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/hwmon/ads7828.c +3 -0
index bce4e9f..6c99ee7 100644
@@ -147,6 +147,9 @@ static int ads7828_probe(struct i2c_client *client,
 						    &ads2830_regmap_config);
 	}
 
+	if (IS_ERR(data->regmap))
+		return PTR_ERR(data->regmap);
+
 	data->cmd_byte = ext_vref ? ADS7828_CMD_PD1 : ADS7828_CMD_PD3;
 	if (!diff_input)
 		data->cmd_byte |= ADS7828_CMD_SD_SE;
Signature · 9 lines
1.9.1




_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors