]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hwmon: (twl4030-madc-hwmon) Initialize uninitialized structure elements
authorGuenter Roeck <linux@roeck-us.net>
Tue, 19 Jun 2012 15:00:00 +0000 (08:00 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 9 Sep 2012 16:29:06 +0000 (09:29 -0700)
twl4030_madc_conversion uses do_avg and type structure elements of
twl4030_madc_request. Initialize to avoid random operation.

Cc: Keerthy <j-keerthy@ti.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/twl4030-madc-hwmon.c

index 0018c7dd0097de5045f646d98e715713ea7edba4..f8ba8b0703547f4d47f25c98a56a28a8eb8911b0 100644 (file)
@@ -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;