drivers: sensors: fix of sensor channel get for z axis

the correct value is returned when using sensor channel get function to
read z-axis value

Signed-off-by: Vojislav Milivojevic <milivojevicvoja@yahoo.com>
This commit is contained in:
Vojislav Milivojevic 2021-08-17 14:18:40 +02:00 committed by Maureen Helm
parent e4ed1d32be
commit fcfb1d9872

View file

@ -353,7 +353,7 @@ static int bmm150_channel_get(const struct device *dev,
bmm150_convert(val, drv_data->sample_y);
break;
case SENSOR_CHAN_MAGN_Z:
bmm150_convert(val, drv_data->sample_x);
bmm150_convert(val, drv_data->sample_z);
break;
case SENSOR_CHAN_MAGN_XYZ:
bmm150_convert(val, drv_data->sample_x);