alistair23-linux/drivers/iio/magnetometer
Richard Leitner 05be8d4101 iio: ak8975: fix maybe-uninitialized warning
If i2c_device_id *id is NULL and acpi_match_device returns NULL too,
then chipset may be unitialized when accessing &ak_def_array[chipset] in
ak8975_probe. Therefore initialize chipset to AK_MAX_TYPE, which will
return an error when not changed.

This patch fixes the following maybe-uninitialized warning:

drivers/iio/magnetometer/ak8975.c: In function ‘ak8975_probe’:
drivers/iio/magnetometer/ak8975.c:788:14: warning: ‘chipset’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
  data->def = &ak_def_array[chipset];

Signed-off-by: Richard Leitner <dev@g0hl1n.net>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-17 12:16:36 +01:00
..
ak8975.c iio: ak8975: fix maybe-uninitialized warning 2016-04-17 12:16:36 +01:00
bmc150_magn.c iio: Reconcile operation order between iio_register/unregister and pm functions 2015-11-08 15:36:53 +00:00
hid-sensor-magn-3d.c
hmc5843.h iio: hmc5843: Move hmc5843 out of staging 2016-02-24 20:40:39 +00:00
hmc5843_core.c iio: hmc5843: Move hmc5843 out of staging 2016-02-24 20:40:39 +00:00
hmc5843_i2c.c iio: hmc5843: Move hmc5843 out of staging 2016-02-24 20:40:39 +00:00
hmc5843_spi.c iio: hmc5843: Move hmc5843 out of staging 2016-02-24 20:40:39 +00:00
Kconfig iio: hmc5843: Move hmc5843 out of staging 2016-02-24 20:40:39 +00:00
mag3110.c
Makefile iio: hmc5843: Move hmc5843 out of staging 2016-02-24 20:40:39 +00:00
mmc35240.c
st_magn.h iio: st_magn: always define ST_MAGN_TRIGGER_SET_STATE 2016-04-03 10:56:42 +01:00
st_magn_buffer.c
st_magn_core.c iio: st_sensors: support active-low interrupts 2016-01-10 12:35:32 +00:00
st_magn_i2c.c
st_magn_spi.c