Patch "iio: adc: ad4000: fix reading unsigned data" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iio: adc: ad4000: fix reading unsigned data

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iio-adc-ad4000-fix-reading-unsigned-data.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ca48d580ce089579cf1dc73c62d4de611ca54b6b
Author: David Lechner <dlechner@xxxxxxxxxxxx>
Date:   Wed Oct 30 16:09:41 2024 -0500

    iio: adc: ad4000: fix reading unsigned data
    
    [ Upstream commit 62dd96ac9cdf2814f41cfc55ecaf22a28aad6ccb ]
    
    Fix reading unsigned data from the AD4000 ADC via the _raw sysfs
    attribute by ensuring that *val is set before returning from
    ad4000_single_conversion(). This was not being set in any code path
    and was causing the attribute to return a random value.
    
    Fixes: 938fd562b974 ("iio: adc: Add support for AD4000")
    Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
    Link: https://patch.msgid.link/20241030-iio-adc-ad4000-fix-reading-unsigned-data-v1-1-2e28dd75fe29@xxxxxxxxxxxx
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iio/adc/ad4000.c b/drivers/iio/adc/ad4000.c
index 6ea4912450849..fc9c9807f89d2 100644
--- a/drivers/iio/adc/ad4000.c
+++ b/drivers/iio/adc/ad4000.c
@@ -344,6 +344,8 @@ static int ad4000_single_conversion(struct iio_dev *indio_dev,
 
 	if (chan->scan_type.sign == 's')
 		*val = sign_extend32(sample, chan->scan_type.realbits - 1);
+	else
+		*val = sample;
 
 	return IIO_VAL_INT;
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux