Skip to content

Commit eaa0df0

Browse files
andy-shevAndi Shyti
authored andcommitted
i2c: bcm-kona: Use i2c_10bit_addr_*_from_msg() helpers
Use i2c_10bit_addr_*_from_msg() helpers instead of local copy. No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250213141045.2716943-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent 6af58d3 commit eaa0df0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/i2c/busses/i2c-bcm-kona.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,12 @@ static int bcm_kona_i2c_do_addr(struct bcm_kona_i2c_dev *dev,
471471

472472
if (msg->flags & I2C_M_TEN) {
473473
/* First byte is 11110XX0 where XX is upper 2 bits */
474-
addr = 0xF0 | ((msg->addr & 0x300) >> 7);
474+
addr = i2c_10bit_addr_hi_from_msg(msg) & ~I2C_M_RD;
475475
if (bcm_kona_i2c_write_byte(dev, addr, 0) < 0)
476476
return -EREMOTEIO;
477477

478478
/* Second byte is the remaining 8 bits */
479-
addr = msg->addr & 0xFF;
479+
addr = i2c_10bit_addr_lo_from_msg(msg);
480480
if (bcm_kona_i2c_write_byte(dev, addr, 0) < 0)
481481
return -EREMOTEIO;
482482

@@ -486,7 +486,7 @@ static int bcm_kona_i2c_do_addr(struct bcm_kona_i2c_dev *dev,
486486
return -EREMOTEIO;
487487

488488
/* Then re-send the first byte with the read bit set */
489-
addr = 0xF0 | ((msg->addr & 0x300) >> 7) | 0x01;
489+
addr = i2c_10bit_addr_hi_from_msg(msg);
490490
if (bcm_kona_i2c_write_byte(dev, addr, 0) < 0)
491491
return -EREMOTEIO;
492492
}

0 commit comments

Comments
 (0)