Skip to contentSkip to conversation

iio:frequency:adf4377: Fix duplicated soft reset mask

PATCH Superseded SeungJu Cheon 2 participants 2 messages Jan 23

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

Fix by using both masks as done in regmap_update_bits() above.

Fixes eda549e2e524 ("iio:frequency:adf4377: add support for ADF4377")

---
v2:
- Add Fixes tag

 drivers/iio/frequency/adf4377.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/frequency/adf4377.c +1 -1
index 08833b7035e4..48aa4b015a14 100644
@@ -501,7 +501,7 @@ static int adf4377_soft_reset(struct adf4377_state *st)
 		return ret;
 
 	return regmap_read_poll_timeout(st->regmap, 0x0, read_val,
-					!(read_val & (ADF4377_0000_SOFT_RESET_R_MSK |
+					!(read_val & (ADF4377_0000_SOFT_RESET_MSK |
 					ADF4377_0000_SOFT_RESET_R_MSK)), 200, 200 * 100);
 }
 
Signature · 1 line
2.52.0
#1 lore raw
Quoted 3 lines · SeungJu Cheon

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.

Yes, but this commit message completely ignored discussion
https://lore.kernel.org/linux-iio/[email protected]/
So it should have summarised the question and answer.

Also this one mistakenly marked v2.

Signature · 2 lines
With Best Regards,
Andy Shevchenko