]> git.baikalelectronics.ru Git - kernel.git/commit
iio: magnetometer: rm3100: Stop abusing the ->currentmode
authorMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 7 Feb 2022 14:38:29 +0000 (15:38 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 10 Apr 2022 15:15:02 +0000 (16:15 +0100)
commitb8a4e674bbf9db4d69835f0d02f39dd5b19e79bb
tree701cf62c97dcef47b61073f81878abb017239ffc
parent75be187ae909cff0fedc5a3b17d94abb8fecee41
iio: magnetometer: rm3100: Stop abusing the ->currentmode

This is an internal variable for the core, here it is set to a "default"
value by the driver in order to later be able to perform checks against
it. None of this is needed because this check actually cares about the
buffers being enabled or not. So it is an unproper side-channel access
to the information "are the buffers enabled?", returned officially by
the iio_buffer_enabled() helper. Use this helper instead.

Cc: Song Qiang <songqiang1304521@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20220207143840.707510-3-miquel.raynal@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/rm3100-core.c