summaryrefslogtreecommitdiff
path: root/drivers/iio
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-29 13:59:53 +0100
commitae75b83897fd96a745950fabf639a48b100740df (patch)
tree71789e395408c9ba771ad29d2667f1d9f0daead4 /drivers/iio
parentd0bdae59b2574b1d827b0e7cf40b9209adc2fba2 (diff)
downloadlinux-ae75b83897fd96a745950fabf639a48b100740df.tar.gz
linux-ae75b83897fd96a745950fabf639a48b100740df.tar.bz2
linux-ae75b83897fd96a745950fabf639a48b100740df.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/iio')
-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 63063e85cd0a..8cae84586abb 100644
--- a/drivers/iio/dac/ad5421.c
+++ b/drivers/iio/dac/ad5421.c
@@ -183,7 +183,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(&indio_dev->mlock);