Skip to content

Commit e7ba303

Browse files
Cezar ChiruAndi Shyti
authored andcommitted
i2c: pcf8584: Make pcf_doAddress() function void
Change pcf_doAddress() function's type from int to void as it always returns 0. This way there is no need for extra assignment and extra checks when the function is called. Remove assignment of pcf_doAddress() and replace it with a simple function call. Suggested-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Cezar Chiru <chiru.cezar.89@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20251023120043.8661-3-chiru.cezar.89@gmail.com
1 parent 11cb461 commit e7ba303

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/i2c/algos/i2c-algo-pcf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,14 @@ static int pcf_readbytes(struct i2c_adapter *i2c_adap, char *buf,
253253
}
254254

255255

256-
static int pcf_doAddress(struct i2c_algo_pcf_data *adap,
256+
static void pcf_doAddress(struct i2c_algo_pcf_data *adap,
257257
struct i2c_msg *msg)
258258
{
259259
unsigned char addr = i2c_8bit_addr_from_msg(msg);
260260

261261
if (msg->flags & I2C_M_REV_DIR_ADDR)
262262
addr ^= 1;
263263
i2c_outb(adap, addr);
264-
265-
return 0;
266264
}
267265

268266
static int pcf_xfer(struct i2c_adapter *i2c_adap,
@@ -288,7 +286,7 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap,
288286
int ret;
289287

290288
pmsg = &msgs[i];
291-
ret = pcf_doAddress(adap, pmsg);
289+
pcf_doAddress(adap, pmsg);
292290

293291
/* Send START */
294292
if (i == 0)

0 commit comments

Comments
 (0)