]> git.ipfire.org Git - thirdparty/linux.git/commit
light: tsl2591: simplify tsl2591_persist functions via lookup table
authorMatheus Silveira <matheus.feitosa@usp.br>
Thu, 28 May 2026 18:55:12 +0000 (15:55 -0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 10:01:51 +0000 (11:01 +0100)
commit40d7dc96cf14e2e37fb9501e7d25fde10b858596
treed598118249f944791f05946826e854d61a0c543b
parent36862727e0079f8edcb2869d994a0d394513d857
light: tsl2591: simplify tsl2591_persist functions via lookup table

Replace switch statements with an indexed lookup table for
persist cycle conversions.

Both functions contain redundant switch statements. This
reduces code duplication and makes future updates to
TSL2591_PRST_ALS_INT_CYCLE_* definitions easier to maintain
by keeping the mapping in a single place.

Signed-off-by: Matheus Silveira <matheus.feitosa@usp.br>
Co-developed-by: Lucas Rabaquim <lucas.rabaquim@usp.br>
Signed-off-by: Lucas Rabaquim <lucas.rabaquim@usp.br>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/tsl2591.c