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

i2c: rzv2m: 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-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Andy Shevchenko and committed by
Andi Shyti
dbb1c2ed 6cdc8fe0

+5 -10
+5 -10
drivers/i2c/busses/i2c-rzv2m.c
··· 287 287 int ret; 288 288 289 289 if (msg->flags & I2C_M_TEN) { 290 - /* 291 - * 10-bit address 292 - * addr_1: 5'b11110 | addr[9:8] | (R/nW) 293 - * addr_2: addr[7:0] 294 - */ 295 - addr = 0xf0 | ((msg->addr & GENMASK(9, 8)) >> 7); 296 - addr |= !!(msg->flags & I2C_M_RD); 297 - /* Send 1st address(extend code) */ 290 + /* 10-bit address: Send 1st address(extend code) */ 291 + addr = i2c_10bit_addr_hi_from_msg(msg); 298 292 ret = rzv2m_i2c_write_with_ack(priv, addr); 299 293 if (ret) 300 294 return ret; 301 295 302 - /* Send 2nd address */ 303 - ret = rzv2m_i2c_write_with_ack(priv, msg->addr & 0xff); 296 + /* 10-bit address: Send 2nd address */ 297 + addr = i2c_10bit_addr_lo_from_msg(msg); 298 + ret = rzv2m_i2c_write_with_ack(priv, addr); 304 299 } else { 305 300 /* 7-bit address */ 306 301 addr = i2c_8bit_addr_from_msg(msg);