summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorQianfeng Rong <rongqianfeng@vivo.com>2025-09-01 21:57:26 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-19 16:23:13 +0200
commit906bb4f98d3a70c8e409aca81cdde82ac6709511 (patch)
treee50dcb4d3759dabdb90cb81a24c1fed0cbb06312 /drivers
parentb2cbd3b2ccd8c1f778fec4f944c51348e3ff6a19 (diff)
downloadlinux-906bb4f98d3a70c8e409aca81cdde82ac6709511.tar.gz
linux-906bb4f98d3a70c8e409aca81cdde82ac6709511.tar.bz2
linux-906bb4f98d3a70c8e409aca81cdde82ac6709511.zip
iio: dac: ad5421: use int type to store negative error codes
commit 3379c900320954d768ed9903691fb2520926bbe3 upstream. Change the 'ret' variable in ad5421_update_ctrl() from unsigned int to int, as it needs to store either negative error codes or zero returned by ad5421_write_unlocked(). Fixes: 5691b23489db ("staging:iio:dac: Add AD5421 driver") Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://patch.msgid.link/20250901135726.17601-3-rongqianfeng@vivo.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/dac/ad5421.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad5421.c b/drivers/iio/dac/ad5421.c
index 7644acfd879e..9228e3cee1b8 100644
--- a/drivers/iio/dac/ad5421.c
+++ b/drivers/iio/dac/ad5421.c
@@ -186,7 +186,7 @@ static int ad5421_update_ctrl(struct iio_dev *indio_dev, unsigned int set,
unsigned int clr)
{
struct ad5421_state *st = iio_priv(indio_dev);
- unsigned int ret;
+ int ret;
mutex_lock(&st->lock);