OSDN Git Service

iio:magnetometer: Replace magic number 0 by IIO_CHAN_INFO_RAW
authorRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Tue, 27 Feb 2018 14:47:55 +0000 (11:47 -0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 3 Mar 2018 15:23:13 +0000 (15:23 +0000)
The function magn_3d_read_raw has a switch statement handling multiple
cases per channel. The first case statement uses the magic number 0,
which means IIO_CHAN_INFO_RAW. Additionally, the iio_chan_spec for
magn_3d_channels is configured to be IIO_CHAN_INFO_RAW. Therefore, this
patch replaces the magic number 0 for the appropriate IIO_CHAN_INFO_RAW.

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/hid-sensor-magn-3d.c

index a1fd9d5..d55c488 100644 (file)
@@ -167,7 +167,7 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev,
        *val = 0;
        *val2 = 0;
        switch (mask) {
-       case 0:
+       case IIO_CHAN_INFO_RAW:
                hid_sensor_power_state(&magn_state->magn_flux_attributes, true);
                report_id =
                        magn_state->magn[chan->address].report_id;