Skip to content

Commit bf74514

Browse files
BoughChenjic23
authored andcommitted
iio: accel: mma8452: ignore the return value of reset operation
On fxls8471, after set the reset bit, the device will reset immediately, will not give ACK. So ignore the return value of this reset operation, let the following code logic to check whether the reset operation works. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Fixes: ecabae7 ("iio: mma8452: Initialise before activating") Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/1655292718-14287-1-git-send-email-haibo.chen@nxp.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 9905394 commit bf74514

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/iio/accel/mma8452.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,10 +1510,14 @@ static int mma8452_reset(struct i2c_client *client)
15101510
int i;
15111511
int ret;
15121512

1513-
ret = i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
1513+
/*
1514+
* Find on fxls8471, after config reset bit, it reset immediately,
1515+
* and will not give ACK, so here do not check the return value.
1516+
* The following code will read the reset register, and check whether
1517+
* this reset works.
1518+
*/
1519+
i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
15141520
MMA8452_CTRL_REG2_RST);
1515-
if (ret < 0)
1516-
return ret;
15171521

15181522
for (i = 0; i < 10; i++) {
15191523
usleep_range(100, 200);

0 commit comments

Comments
 (0)