On Tue, Apr 20, 2021 at 11:50 AM Tomas Melin <tomas.melin@xxxxxxxxxxx> wrote:
Maybe it's not redundant after all (I noticed other magic numbers inSorry, not ignored but will remove this redundant 0x0 for next round.+ sca_data->txbuf[0] = 0x0 | (SCA3300_REG_STATUS << 2);Seems you ignored my comment. What is this 0x0? What is the meaning of it?
Same for all the rest magic numbers in the code.
the same position)? Please, comment your intention case-by-case.
...
Why? Care to explain?IRQ_HANDLED seemed more correct than IRQ_NONE.+ for_each_set_bit(bit, indio_dev->active_scan_mask,Does it mean interrupt is handled in this case?
+ indio_dev->masklength) {
+ ret = sca3300_read_reg(data, sca3300_channels[bit].address,
+ &val);
+ if (ret) {
+ dev_err(&data->spi->dev,
+ "failed to read register, error: %d\n", ret);
+ goto out;
Perhaps a comment why it's okay to consider so?
Or did You have someBut what if this is the very first interrupt (bit in the loop) that
other option in mind?
How about something like:
/* handled with errors */
failed? What about the rest?
goto out;
+ }
+ data->scan.channels[i++] = val;
+ }