Skip to content

Commit 980aa52

Browse files
Shetty-Anushbuha
authored andcommitted
drivers: dac: ad5710r: Fix register address selection
Select correct register address for the specified channel in ad5710r_set_operating_mode() function Signed-off-by: Anush Shetty <[email protected]>
1 parent 915235e commit 980aa52

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/dac/ad5710r/ad5710r.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,7 @@ int ad5710r_set_operating_mode(struct ad5710r_desc *desc, uint8_t chn_num,
595595
return -EINVAL;
596596

597597
ret = ad5710r_spi_write_mask(desc,
598-
chn_num < AD5710R_MAX_CHANNEL_OP_MODE_0 ? AD5710R_REG_ADDR_OPERATING_MODE_0 :
599-
AD5710R_REG_ADDR_OPERATING_MODE_1,
598+
AD5710R_REG_ADDR_OPERATING_MODE_CHN(chn_num),
600599
AD5710R_MASK_OPERATING_MODE(chn_num),
601600
chn_op_mode);
602601
if (ret)

0 commit comments

Comments
 (0)