* [PATCH] iio:magnetometer: Replace magic number 0 by IIO_CHAN_INFO_RAW
@ 2018-02-27 14:47 Rodrigo Siqueira
2018-03-03 15:23 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Rodrigo Siqueira @ 2018-02-27 14:47 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler
Cc: daniel.baluta, kernel-janitors, linux-iio, linux-kernel
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>
---
drivers/iio/magnetometer/hid-sensor-magn-3d.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index a1fd9d591818..d55c4885211a 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -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;
--
2.16.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio:magnetometer: Replace magic number 0 by IIO_CHAN_INFO_RAW
2018-02-27 14:47 [PATCH] iio:magnetometer: Replace magic number 0 by IIO_CHAN_INFO_RAW Rodrigo Siqueira
@ 2018-03-03 15:23 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-03-03 15:23 UTC (permalink / raw)
To: Rodrigo Siqueira
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
daniel.baluta, kernel-janitors, linux-iio, linux-kernel
On Tue, 27 Feb 2018 11:47:55 -0300
Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> wrote:
> 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>
Applied to the togreg branch of iio.git and pushed out as testing.
Thanks,
Jonathan
> ---
> drivers/iio/magnetometer/hid-sensor-magn-3d.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> index a1fd9d591818..d55c4885211a 100644
> --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> @@ -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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-03 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-27 14:47 [PATCH] iio:magnetometer: Replace magic number 0 by IIO_CHAN_INFO_RAW Rodrigo Siqueira
2018-03-03 15:23 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).