Skip to content

Commit 6c8bf4b

Browse files
suunjjic23
authored andcommitted
iio: frequency: adf4377: Fix duplicated soft reset mask
The regmap_read_poll_timeout() uses ADF4377_0000_SOFT_RESET_R_MSK twice instead of checking both SOFT_RESET_MSK (bit 0) and SOFT_RESET_R_MSK (bit 7). This causes an incomplete reset status check. The code first sets both SOFT_RESET and SOFT_RESET_R bits to 1 via regmap_update_bits(), then polls for them to be cleared. Since we set both bits before polling, we should be waiting for both to clear. Fix by using both masks as done in regmap_update_bits() above. Fixes: eda549e ("iio: frequency: adf4377: add support for ADF4377") Signed-off-by: SeungJu Cheon <suunj1331@gmail.com> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent dd72e6c commit 6c8bf4b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iio/frequency/adf4377.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static int adf4377_soft_reset(struct adf4377_state *st)
508508
return ret;
509509

510510
return regmap_read_poll_timeout(st->regmap, 0x0, read_val,
511-
!(read_val & (ADF4377_0000_SOFT_RESET_R_MSK |
511+
!(read_val & (ADF4377_0000_SOFT_RESET_MSK |
512512
ADF4377_0000_SOFT_RESET_R_MSK)), 200, 200 * 100);
513513
}
514514

0 commit comments

Comments
 (0)