From: Guenter Roeck Date: Tue, 19 Jun 2012 15:00:00 +0000 (-0700) Subject: hwmon: (twl4030-madc-hwmon) Initialize uninitialized structure elements X-Git-Tag: next-20120912~86^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3eb436d44e0e8284b0d89b604cf7e0ec457167a8;p=karo-tx-linux.git hwmon: (twl4030-madc-hwmon) Initialize uninitialized structure elements twl4030_madc_conversion uses do_avg and type structure elements of twl4030_madc_request. Initialize to avoid random operation. Cc: Keerthy Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/twl4030-madc-hwmon.c b/drivers/hwmon/twl4030-madc-hwmon.c index 0018c7dd0097..f8ba8b070354 100644 --- a/drivers/hwmon/twl4030-madc-hwmon.c +++ b/drivers/hwmon/twl4030-madc-hwmon.c @@ -50,6 +50,8 @@ static ssize_t madc_read(struct device *dev, req.channels = (1 << attr->index); req.method = TWL4030_MADC_SW2; req.func_cb = NULL; + req.do_avg = 0; + req.type = TWL4030_MADC_WAIT; val = twl4030_madc_conversion(&req); if (val < 0) return val;