diff options
| author | Salah Triki <salah.triki@gmail.com> | 2026-04-27 22:33:19 +0100 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-05-15 12:05:34 +0100 |
| commit | d0a228d903425e653f18a4341e60c0538afb6d41 (patch) | |
| tree | a41cf4e7ab2a45fd9eb602817e62b8849757c85c /scripts/objdiff | |
| parent | f9bbd943c34a9ad60e593a4b99ce2394e4e2381b (diff) | |
iio: dac: max5821: fix return value check in powerdown sync
The function max5821_sync_powerdown_mode() returned the result of
i2c_master_send() directly. If a partial transfer occurred, it would
be incorrectly treated as a success by the caller.
While the caller currently handles the positive return value of 2 as
success, this patch refactors the function to return 0 on full success
and -EIO on short writes. This ensures robust error handling for
incomplete transfers and improves code maintainability by using
sizeof(outbuf).
Fixes: 472988972737 ("iio: add support of the max5821")
Signed-off-by: Salah Triki <salah.triki@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
