Skip to content

Commit 13ff3e7

Browse files
minimaxwellkuba-moo
authored andcommitted
net: sfp: return the number of written bytes for smbus single byte access
We expect the SFP write accessors to return the number of written bytes. We fail to do so for single-byte smbus accesses, which may cause errors when setting a module's high-power state and for some cotsworks modules. Let's return the amount of written bytes, as expected. Fixes: 7662abf ("net: phy: sfp: Add support for SMBus module access") Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20260105151840.144552-1-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e5c8eda commit 13ff3e7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/phy/sfp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ static int sfp_smbus_byte_write(struct sfp *sfp, bool a2, u8 dev_addr,
765765
dev_addr++;
766766
}
767767

768-
return 0;
768+
return data - (u8 *)buf;
769769
}
770770

771771
static int sfp_i2c_configure(struct sfp *sfp, struct i2c_adapter *i2c)

0 commit comments

Comments
 (0)