Skip to content

Commit

Permalink
hwmon: (ads7828) Check return value of devm_regmap_init_i2c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
AxelLin authored and groeck committed Feb 23, 2015
1 parent c517d83 commit d9ef72c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/hwmon/ads7828.c
Expand Up @@ -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;
Expand Down

0 comments on commit d9ef72c

Please sign in to comment.