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

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

 



On 12/1/23 19:20, Jonathan Cameron wrote:
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.

So, dropped, since this chip seems to be very much legacy hardware.




[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