Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Axel Lin and committed by
Guenter Roeck
d9ef72cd c517d838

+3
+3
drivers/hwmon/ads7828.c
··· 147 147 &ads2830_regmap_config); 148 148 } 149 149 150 + if (IS_ERR(data->regmap)) 151 + return PTR_ERR(data->regmap); 152 + 150 153 data->cmd_byte = ext_vref ? ADS7828_CMD_PD1 : ADS7828_CMD_PD3; 151 154 if (!diff_input) 152 155 data->cmd_byte |= ADS7828_CMD_SD_SE;