Re: [PATCH v5 2/2] iio: light: isl76682: Add ISL76682 driver

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

 



On Sun, 26 Nov 2023 23:17:55 +0100
Marek Vasut <marex@xxxxxxx> wrote:

> On 11/26/23 20:33, Dr.-Ing. Andre Werner wrote:
> 
> [...]
> 
> > +static int isl76682_write_raw(struct iio_dev *indio_dev,
> > +			      struct iio_chan_spec const *chan,
> > +			      int val, int val2, long mask)
> > +{
> > +	struct isl76682_chip *chip = iio_priv(indio_dev);
> > +	int i;
> > +
> > +	if (chan->type != IIO_LIGHT && chan->type != IIO_INTENSITY)
> > +		return -EINVAL;
> > 
> > In my understanding, this is not necessary as you use that 'iio_chan_spec' to specify
> > the channels available at all. So there will be no other channel types created by the IIO environment, I think.  
> 
> That's a good point, I think we can drop it in this case and the next one.
> 
> Jonathan , is there any reason you can think of why this shouldn't be 
> dropped ?

I don't mind a little paranoia, but fine with dropping it as well.

The reason paranoia is fine is that if other channels are added in future
we might not remember to fix this up if they happen to have no writeable attributes.
I leave that assessment up to driver authors.

Jonathan

> 
> I'll add it into V6, thanks.
> 





[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