> -----Original Message----- > From: linux-iio-owner@xxxxxxxxxxxxxxx [mailto:linux-iio- > owner@xxxxxxxxxxxxxxx] On Behalf Of Hartmut Knaack > Sent: Tuesday, July 28, 2015 1:49 AM > To: linux-iio@xxxxxxxxxxxxxxx > Cc: Jonathan Cameron; Lars-Peter Clausen; Peter Meerwald; Breana, Tiberiu > A > Subject: [PATCH 2/7] iio:accel:stk8312: check for invalid value > > Revision 1.2 of the datasheet recommends on page 22 to only write non-zero > values read from OTP register 0x70 into AFECTRL register. > > Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx> +1 Reviewed-by: Tiberiu Breana <tiberiu.a.breana@xxxxxxxxx> > --- > drivers/iio/accel/stk8312.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c index > c2bd1444d6da..6592be8e6377 100644 > --- a/drivers/iio/accel/stk8312.c > +++ b/drivers/iio/accel/stk8312.c > @@ -150,6 +150,8 @@ static int stk8312_otp_init(struct stk8312_data *data) > goto exit_err; > > ret = i2c_smbus_read_byte_data(client, STK8312_REG_OTPDATA); > + if (ret == 0) > + ret = -EINVAL; > if (ret < 0) > goto exit_err; > > -- > 2.4.6 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body > of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at > http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html