]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i2c: pcf8584: Make pcf_doAddress() function void
authorCezar Chiru <chiru.cezar.89@gmail.com>
Thu, 23 Oct 2025 12:00:42 +0000 (15:00 +0300)
committerAndi Shyti <andi.shyti@kernel.org>
Tue, 28 Oct 2025 16:05:25 +0000 (17:05 +0100)
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
drivers/i2c/algos/i2c-algo-pcf.c

index 06b9fd355bff34bac9ff4e89fffd3beda0716bb4..6352314e48ed25065ea6ad9e20a434571c5b7872 100644 (file)
@@ -253,7 +253,7 @@ static int pcf_readbytes(struct i2c_adapter *i2c_adap, char *buf,
 }
 
 
-static int pcf_doAddress(struct i2c_algo_pcf_data *adap,
+static void pcf_doAddress(struct i2c_algo_pcf_data *adap,
                         struct i2c_msg *msg)
 {
        unsigned char addr = i2c_8bit_addr_from_msg(msg);
@@ -261,8 +261,6 @@ static int pcf_doAddress(struct i2c_algo_pcf_data *adap,
        if (msg->flags & I2C_M_REV_DIR_ADDR)
                addr ^= 1;
        i2c_outb(adap, addr);
-
-       return 0;
 }
 
 static int pcf_xfer(struct i2c_adapter *i2c_adap,
@@ -288,7 +286,7 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap,
                int ret;
 
                pmsg = &msgs[i];
-               ret = pcf_doAddress(adap, pmsg);
+               pcf_doAddress(adap, pmsg);
 
                /* Send START */
                if (i == 0)