]> Git Repo - linux.git/commitdiff
iio: accel: mma8452: ignore the return value of reset operation
authorHaibo Chen <[email protected]>
Wed, 15 Jun 2022 11:31:58 +0000 (19:31 +0800)
committerJonathan Cameron <[email protected]>
Sun, 19 Jun 2022 16:22:49 +0000 (17:22 +0100)
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 <[email protected]>
Fixes: ecabae713196 ("iio: mma8452: Initialise before activating")
Reviewed-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
drivers/iio/accel/mma8452.c

index 4156d216c640ab0fe3172683ff7d2efb952aad71..f4f835274d751f68492ee3c8eee4bfb4191d2d4e 100644 (file)
@@ -1510,10 +1510,14 @@ static int mma8452_reset(struct i2c_client *client)
        int i;
        int ret;
 
-       ret = i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
+       /*
+        * Find on fxls8471, after config reset bit, it reset immediately,
+        * and will not give ACK, so here do not check the return value.
+        * The following code will read the reset register, and check whether
+        * this reset works.
+        */
+       i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
                                        MMA8452_CTRL_REG2_RST);
-       if (ret < 0)
-               return ret;
 
        for (i = 0; i < 10; i++) {
                usleep_range(100, 200);
This page took 0.059341 seconds and 4 git commands to generate.