Re: [PATCH v2 3/4] iio: vcnl4000: Export near level property for proximity sensor

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

 



On Mon, Mar 16, 2020 at 7:47 PM Guido Günther <agx@xxxxxxxxxxx> wrote:
>
> When an object can be considered close to the sensor is hardware
> dependent. Allowing to configure the property via device tree
> allows to configure this device specific value.
>
> This is useful for e.g. iio-sensor-proxy to indicate to userspace
> if an object is close to the sensor.

...

> @@ -342,6 +343,26 @@ static const struct vcnl4000_chip_spec vcnl4000_chip_spec_cfg[] = {
>         },
>  };
>

> +

No need for this blank line.

> +static ssize_t vcnl4000_read_near_level(struct iio_dev *indio_dev,
> +                                       uintptr_t priv,
> +                                       const struct iio_chan_spec *chan,
> +                                       char *buf)

...

> +       if (device_property_read_u32(&client->dev, "near-level",
> +                                    &data->near_level) < 0)

It doesn't return > 0. So, you may drop that and put everything to one
line I think.

> +               data->near_level = 0;

-- 
With Best Regards,
Andy Shevchenko




[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