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

i2c: ibm_iic: Use i2c_*bit_addr*_from_msg() helpers

Use i2c_*bit_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-10-andriy.shevchenko@linux.intel.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Andy Shevchenko and committed by
Andi Shyti
2ee44152 dbb1c2ed

+6 -8
+6 -8
drivers/i2c/busses/i2c-ibm_iic.c
··· 512 512 static inline void iic_address(struct ibm_iic_private* dev, struct i2c_msg* msg) 513 513 { 514 514 volatile struct iic_regs __iomem *iic = dev->vaddr; 515 - u16 addr = msg->addr; 516 515 517 516 DBG2("%d: iic_address, 0x%03x (%d-bit)\n", dev->idx, 518 - addr, msg->flags & I2C_M_TEN ? 10 : 7); 517 + msg->addr, msg->flags & I2C_M_TEN ? 10 : 7); 519 518 520 - if (msg->flags & I2C_M_TEN){ 519 + if (msg->flags & I2C_M_TEN) { 521 520 out_8(&iic->cntl, CNTL_AMD); 522 - out_8(&iic->lmadr, addr); 523 - out_8(&iic->hmadr, 0xf0 | ((addr >> 7) & 0x06)); 524 - } 525 - else { 521 + out_8(&iic->lmadr, i2c_10bit_addr_lo_from_msg(msg)); 522 + out_8(&iic->hmadr, i2c_10bit_addr_hi_from_msg(msg) & ~I2C_M_RD); 523 + } else { 526 524 out_8(&iic->cntl, 0); 527 - out_8(&iic->lmadr, addr << 1); 525 + out_8(&iic->lmadr, i2c_8bit_addr_from_msg(msg) & ~I2C_M_RD); 528 526 } 529 527 } 530 528