Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9ef72cd authored by Axel Lin's avatar Axel Lin Committed by Guenter Roeck
Browse files

hwmon: (ads7828) Check return value of devm_regmap_init_i2c



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

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent c517d838
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;