summaryrefslogtreecommitdiff
path: root/drivers/iio/magnetometer
diff options
context:
space:
mode:
authorJakob Hauser <jahau@rocketmail.com>2022-08-13 00:54:07 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-08-16 00:30:03 +0300
commit4efdfbc16cceffbcb29e53a5be55d83a4c76a9c0 (patch)
treefdcc3cfee45b27a019dc7376845600a4b175fffd /drivers/iio/magnetometer
parente137fafc8985cf152a4bb6f18ae83ebb06816df1 (diff)
downloadlinux-4efdfbc16cceffbcb29e53a5be55d83a4c76a9c0.tar.xz
iio: magnetometer: yas530: Change range of data in volatile register
In function yas5xx_volatile_reg(), register "YAS5XX_MEASURE_DATA + 8" shouldn't be volatile as we count from 0 to 7 here. Instead of lowering the number from 8 to 7, the operator "<=" is replaced by "<". The size of the measure data array is 8, therefore it's more natural to use 8 as a constant. This change is of low importance as the "+ 8" register isn't called. Signed-off-by: Jakob Hauser <jahau@rocketmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/dabba10feb80171350525ac874f944076c46e084.1660337264.git.jahau@rocketmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/magnetometer')
-rw-r--r--drivers/iio/magnetometer/yamaha-yas530.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c
index d1f16729c60e..76bff4818461 100644
--- a/drivers/iio/magnetometer/yamaha-yas530.c
+++ b/drivers/iio/magnetometer/yamaha-yas530.c
@@ -527,7 +527,7 @@ static bool yas5xx_volatile_reg(struct device *dev, unsigned int reg)
{
return reg == YAS5XX_ACTUATE_INIT_COIL ||
reg == YAS5XX_MEASURE ||
- (reg >= YAS5XX_MEASURE_DATA && reg <= YAS5XX_MEASURE_DATA + 8);
+ (reg >= YAS5XX_MEASURE_DATA && reg < YAS5XX_MEASURE_DATA + 8);
}
/* TODO: enable regmap cache, using mark dirty and sync at runtime resume */