Re: [PATCH v3 1/9] iio: light: rpr0521 disable sensor -bugfix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5.5.2017 14:24, Daniel Baluta wrote:
> On Fri, May 5, 2017 at 2:19 PM, Mikko Koivunen
> <mikko.koivunen@xxxxxxxxxxxxxxxxx> wrote:
>> Sensor was marked enabled on each call even if the call was for disabling
>> sensor.
>>
>> Signed-off-by: Mikko Koivunen <mikko.koivunen@xxxxxxxxxxxxxxxxx>
>> ---
>> Tested on LeMaker HiKey with AOSP7.1 kernel 4.4.
>> Patch v2->v3 changes:
>> whitespace change.
>>
>>  drivers/iio/light/rpr0521.c |   10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c
>> index 7de0f39..03504f6 100644
>> --- a/drivers/iio/light/rpr0521.c
>> +++ b/drivers/iio/light/rpr0521.c
>> @@ -197,7 +197,10 @@ static int rpr0521_als_enable(struct rpr0521_data *data, u8 status)
>>         if (ret < 0)
>>                 return ret;
>>
>> -       data->als_dev_en = true;
> How about:
>
> data->als_dev_en = !!(status & RPR0521_MODE_ALS_MASK);
>
> Thanks for fixing this!
>
I got the impression previously that we should prefer verbosity instead
of shortness when it helps understanding the code. Otherwise yes, that
could work too.

-Mikko

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux