Arnd Bergmann 17fa2dcbd6 iio: adc: handle unknow of_device_id data
If we get an unknown 'childmode' value, a number of variables are not
initialized properly:

drivers/iio/adc/rcar-gyroadc.c: In function 'rcar_gyroadc_probe':
drivers/iio/adc/rcar-gyroadc.c:390:5: error: 'num_channels' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/iio/adc/rcar-gyroadc.c:426:22: error: 'sample_width' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/iio/adc/rcar-gyroadc.c:428:23: error: 'channels' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The driver is currently correct, but handling this properly is more robust
for possible modifications.

There is also a false-positive warning about adcmode being possibly uninitialized,
but that cannot happen as we also check the 'first' flag:

drivers/iio/adc/rcar-gyroadc.c:398:26: error: 'adcmode' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This adds an initialization for 'adcmode' and bails out for any unknown childmode.

Fixes: 059c53b32329 ("iio: adc: Add Renesas GyroADC driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-05 09:30:15 +00:00
..
2016-12-25 17:21:22 +01:00
2016-12-25 10:47:44 +01:00
2017-01-06 14:34:52 +01:00
2016-12-18 15:49:10 -08:00
2016-12-25 17:21:22 +01:00
2016-12-14 11:14:28 -08:00
2017-01-04 16:38:39 +01:00
2016-12-19 08:16:26 -08:00
2017-01-06 11:19:03 -08:00
2016-12-25 17:21:22 +01:00
2017-01-06 10:49:36 -08:00
2016-12-25 10:47:44 +01:00
2016-12-25 17:21:22 +01:00
2016-12-25 17:21:22 +01:00
2017-01-23 12:03:57 +00:00
2016-12-18 15:49:10 -08:00
2016-12-15 12:46:48 -08:00
2016-12-25 17:21:22 +01:00
2016-12-25 10:47:44 +01:00
2016-12-14 10:49:33 -08:00
2016-12-25 17:21:22 +01:00
2017-01-25 16:11:55 +00:00
2016-12-19 08:16:26 -08:00
2016-12-15 16:03:25 -08:00
2016-12-13 08:52:45 -08:00
2016-12-25 17:21:22 +01:00
2016-12-25 17:21:22 +01:00
2016-12-16 09:26:42 -08:00
2016-12-14 20:42:45 -08:00
2016-12-24 11:27:45 -08:00