Tue, Jan 10, 2023 at 02:43:22PM +0100, Mårten Lindahl kirjoitti: > This driver supports 4 chips, by which only one (vcnl4010) handles > interrupts and has support for triggered buffer. The setup of these > functions is hardcoded for vcnl4010 inside the generic vcnl4000_probe, > and thus ignores the chip specific configuration structure where all > other chip specific functions are specified. > > This complicates adding interrupt handler and triggered buffer support > to chips which may have support for it. > > Add members for irq threads and iio_buffer_setup_ops to the generic > vcnl4000_chip_spec struct, so that instead of checking a chip specific > boolean irq support, we check for a chip specific triggered buffer > handler, and/or a chip specific irq thread handler. ... > - ret = devm_iio_triggered_buffer_setup(&client->dev, indio_dev, > - NULL, > + ret = devm_iio_triggered_buffer_setup(&client->dev, > + indio_dev, NULL, What the point of this part of the hunk? ... > + if (client->irq) { > + if (data->chip_spec->irq_thread) { I have checked the rest of the series and found nothing that prevents this to be written as if (client->irq && data->chip_spec->irq_thread) { This will reduce the noise in the patch. > } -- With Best Regards, Andy Shevchenko