Commit 13ff3e72 authored by Maxime Chevallier's avatar Maxime Chevallier Committed by Jakub Kicinski
Browse files

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: 7662abf4 ("net: phy: sfp: Add support for SMBus module access")
Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260105151840.144552-1-maxime.chevallier@bootlin.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e5c8eda3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -765,7 +765,7 @@ static int sfp_smbus_byte_write(struct sfp *sfp, bool a2, u8 dev_addr,
		dev_addr++;
	}

	return 0;
	return data - (u8 *)buf;
}

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