Commit e9cd6a4b authored by Marek Vasut's avatar Marek Vasut Committed by sanglipeng
Browse files

iio: dac: mcp4725: Fix i2c_master_send() return value handling

stable inclusion
from stable-v5.10.183
commit 143dbb313aea42e5e966e027386422b445bbd369
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8IRR2

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=143dbb313aea42e5e966e027386422b445bbd369



--------------------------------

commit 09d3bec7 upstream.

The i2c_master_send() returns number of sent bytes on success,
or negative on error. The suspend/resume callbacks expect zero
on success and non-zero on error. Adapt the return value of the
i2c_master_send() to the expectation of the suspend and resume
callbacks, including proper validation of the return value.

Fixes: cf35ad61 ("iio: add mcp4725 I2C DAC driver")
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230511004330.206942-1-marex@denx.de


Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent b800fa3e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment