From: Michał Mirosław Date: Thu, 17 Aug 2017 13:56:11 +0000 (+0200) Subject: iio: magnetometer: ak8974: mark INT_CLEAR as precious X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9991f99eed49047c237e08471ce010cae02052fe;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iio: magnetometer: ak8974: mark INT_CLEAR as precious Reading INT_CLEAR has side effects - disallow reading it via debugfs. Signed-off-by: Michał Mirosław Reviewed-by: Linus Walleij Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index b1c209faf1b1..866f20b818b1 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -661,11 +661,17 @@ static bool ak8974_writeable_reg(struct device *dev, unsigned int reg) } } +static bool ak8974_precious_reg(struct device *dev, unsigned int reg) +{ + return reg == AK8974_INT_CLEAR; +} + static const struct regmap_config ak8974_regmap_config = { .reg_bits = 8, .val_bits = 8, .max_register = 0xff, .writeable_reg = ak8974_writeable_reg, + .precious_reg = ak8974_precious_reg, }; static int ak8974_probe(struct i2c_client *i2c,