mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
iio: adc: ad7380: fix adi,gain-milli property parsing
Change the data type of the "adi,gain-milli" property from u32 to u16.
The devicetree binding specifies it as uint16, so we need to read it as
such to avoid an -EOVERFLOW error when parsing the property.
Fixes: c904e6dcf4
("iio: adc: ad7380: add support for adaq4370-4 and adaq4380-4")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250619-iio-adc-ad7380-fix-adi-gain-milli-parsing-v1-1-4c27fb426860@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
7b86482632
commit
24fa69894e
|
@ -1953,8 +1953,9 @@ static int ad7380_probe(struct spi_device *spi)
|
|||
|
||||
if (st->chip_info->has_hardware_gain) {
|
||||
device_for_each_child_node_scoped(dev, node) {
|
||||
unsigned int channel, gain;
|
||||
unsigned int channel;
|
||||
int gain_idx;
|
||||
u16 gain;
|
||||
|
||||
ret = fwnode_property_read_u32(node, "reg", &channel);
|
||||
if (ret)
|
||||
|
@ -1966,7 +1967,7 @@ static int ad7380_probe(struct spi_device *spi)
|
|||
"Invalid channel number %i\n",
|
||||
channel);
|
||||
|
||||
ret = fwnode_property_read_u32(node, "adi,gain-milli",
|
||||
ret = fwnode_property_read_u16(node, "adi,gain-milli",
|
||||
&gain);
|
||||
if (ret && ret != -EINVAL)
|
||||
return dev_err_probe(dev, ret,
|
||||
|
|
Loading…
Reference in New Issue
Block a user