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]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux