Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Andi Shyti
eaa0df0d 6af58d3e

+3 -3
+3 -3
drivers/i2c/busses/i2c-bcm-kona.c
··· 471 471 472 472 if (msg->flags & I2C_M_TEN) { 473 473 /* 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; 475 475 if (bcm_kona_i2c_write_byte(dev, addr, 0) < 0) 476 476 return -EREMOTEIO; 477 477 478 478 /* Second byte is the remaining 8 bits */ 479 - addr = msg->addr & 0xFF; 479 + addr = i2c_10bit_addr_lo_from_msg(msg); 480 480 if (bcm_kona_i2c_write_byte(dev, addr, 0) < 0) 481 481 return -EREMOTEIO; 482 482 ··· 486 486 return -EREMOTEIO; 487 487 488 488 /* 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); 490 490 if (bcm_kona_i2c_write_byte(dev, addr, 0) < 0) 491 491 return -EREMOTEIO; 492 492 }