Re: [PATCH] hwmon: (sht3x) Return the consumed count for heater writes

From: Guenter Roeck

Date: Mon Oct 19 2026 - 16:20:25 EST


On Tue, Oct 20, 2026 at 12:47:18AM +0900, Baek Kyu, Kim wrote:
> heater_enable_store() returns the result of i2c_master_send(), which is
> the two-byte command length on success rather than the sysfs input
> count. This can report more bytes than were supplied, or a partial write
> for a fully processed input. For example, writing "on\n" returns two
> instead of three, so a caller retrying the remaining newline gets
> -EINVAL even though the heater command succeeded. Retrying the remainder
> of "off\n" can also send the heater-off command twice.
>
> Return count after a complete command transfer. Preserve negative I2C
> errors and return -EIO for nonnegative incomplete transfers, so a
> zero-message transfer is not reported as a successful zero-byte write.
> Keep the existing boolean parsing, command selection and locking.
>
> Fixes: 50c22cd154e5 ("hwmon: (sht3x) add humidity heater element control")
> Signed-off-by: Baek Kyu, Kim <pocj8ur4in@xxxxxxxxx>

Applied.

Thanks,
Guenter