summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-02-10 13:24:07 +0300
committerGuenter Roeck <linux@roeck-us.net>2015-02-23 07:10:30 +0300
commitd9ef72cd1c15c2fc1f7131cd78304dd21bc15953 (patch)
tree25b8d09b85c64ccad5ded9a2f8b5bf2dab710790 /drivers/hwmon
parentc517d838eb7d07bbe9507871fab3931deccff539 (diff)
downloadlinux-d9ef72cd1c15c2fc1f7131cd78304dd21bc15953.tar.xz
hwmon: (ads7828) Check return value of devm_regmap_init_i2c
devm_regmap_init_i2c() can fail, thus add return value checking. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/ads7828.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index bce4e9ff21bf..6c99ee7bafa3 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -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;