Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 852afe99 authored by Denis CIOCCA's avatar Denis CIOCCA Committed by Jonathan Cameron
Browse files

iio:common:st_sensors fixed all warning messages about uninitialized variables

parent 5a4d7291
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ static int st_sensors_match_odr(struct st_sensors *sensor,
int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr)
{
	int err;
	struct st_sensor_odr_avl odr_out;
	struct st_sensor_odr_avl odr_out = {0, 0};
	struct st_sensor_data *sdata = iio_priv(indio_dev);

	err = st_sensors_match_odr(sdata->sensor, odr, &odr_out);
@@ -114,7 +114,7 @@ static int st_sensors_match_fs(struct st_sensors *sensor,

static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs)
{
	int err, i;
	int err, i = 0;
	struct st_sensor_data *sdata = iio_priv(indio_dev);

	err = st_sensors_match_fs(sdata->sensor, fs, &i);
@@ -139,14 +139,13 @@ static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs)

int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable)
{
	bool found;
	u8 tmp_value;
	int err = -EINVAL;
	struct st_sensor_odr_avl odr_out;
	bool found = false;
	struct st_sensor_odr_avl odr_out = {0, 0};
	struct st_sensor_data *sdata = iio_priv(indio_dev);

	if (enable) {
		found = false;
		tmp_value = sdata->sensor->pw.value_on;
		if ((sdata->sensor->odr.addr == sdata->sensor->pw.addr) &&
			(sdata->sensor->odr.mask == sdata->sensor->pw.mask)) {