* [lm-sensors] [PATCH] hwmon: (ads7828) Check return value of devm_regmap_init_i2c
@ 2015-02-10 10:24 Axel Lin
2015-02-10 12:21 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2015-02-10 10:24 UTC (permalink / raw)
To: lm-sensors
devm_regmap_init_i2c() can fail, thus add return value checking.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/hwmon/ads7828.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index bce4e9f..6c99ee7 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;
--
1.9.1
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (ads7828) Check return value of devm_regmap_init_i2c
2015-02-10 10:24 [lm-sensors] [PATCH] hwmon: (ads7828) Check return value of devm_regmap_init_i2c Axel Lin
@ 2015-02-10 12:21 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2015-02-10 12:21 UTC (permalink / raw)
To: lm-sensors
On 02/10/2015 02:24 AM, Axel Lin wrote:
> devm_regmap_init_i2c() can fail, thus add return value checking.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
Applied.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-10 12:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-10 10:24 [lm-sensors] [PATCH] hwmon: (ads7828) Check return value of devm_regmap_init_i2c Axel Lin
2015-02-10 12:21 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.