iio: light: apds9306: Refactor threshold get/set functions to use helper
authorNattan Ferreira <nattanferreira58@gmail.com>
Wed, 11 Jun 2025 17:42:53 +0000 (14:42 -0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 26 Jun 2025 18:32:54 +0000 (19:32 +0100)
commit6f6bf97823451dceda121e7341b41ce8d0560c14
tree9397a74b2795050556f6d31aac77e48b0926578f
parentfb1d3b24ebf5c85f4179cb045ee28715e249e1ca
iio: light: apds9306: Refactor threshold get/set functions to use helper

Refactor the apds9306_event_thresh_get() and apds9306_event_thresh_set()
functions to use a helper function (apds9306_get_thresh_reg()) for
obtaining the correct register based on the direction of the event. This
improves code readability and maintains consistency in accessing
threshold registers.

Signed-off-by: Nattan Ferreira <nattanferreira58@gmail.com>
Co-developed-by: Lucas Antonio <lucasantonio.santos@usp.br>
Signed-off-by: Lucas Antonio <lucasantonio.santos@usp.br>
Acked-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Link: https://patch.msgid.link/20250611174253.16578-1-nattanferreira58@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/apds9306.c