thermal/drivers/mediatek/lvts_thermal: Allow early empty sensor slots
authorNicolas Pitre <npitre@baylibre.com>
Tue, 2 Apr 2024 03:25:45 +0000 (23:25 -0400)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 23 Apr 2024 10:40:30 +0000 (12:40 +0200)
commit11e6f4c3144743b2b2c26a5cd58ae3696379b3ab
tree858f4df1e322efdca189fb94b38cc9d2f9150833
parent684cbb49f9ceed6be0f33dac9d62089e7cd1c032
thermal/drivers/mediatek/lvts_thermal: Allow early empty sensor slots

Some systems don't always populate sensor controller slots starting
at slot 0. Use a bitmap instead of a count to indicate valid sensor
slots. Also create a pretty iterator for that.

About that iterator: it causes checkpatch to complain with "ERROR:
Macros with multiple statements should be enclosed in a do - while
loop". However this is not possible here. And many similar iterators
do exist using the same form in the tree already.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20240402032729.2736685-12-nico@fluxnic.net
drivers/thermal/mediatek/lvts_thermal.c