Skip to content

Commit d53bfdf

Browse files
xdarklightjic23
authored andcommitted
iio: adc: meson-saradc: Use the parent device to look up the calib data
On the older-gen 32-bit SoCs the meson-saradc driver is used to read the SoC temperature. This requires reading calibration data from the eFuse. Looking up the calibration data nvmem-cell requires the OF device_node pointer to be available in the struct device which is passed to devm_nvmem_cell_get(). This however got lost with commit 8cb631c ("iio: Remove superfluous of_node assignments") from indio_dev->dev. As devm_nvmem_cell_get() is called in the initialization phase the device_node is not yet available because the NVMEM cell is looked up before iio_device_register() is called (which would then set the device_node automatically). Use the parent device to look up the NVMEM cell instead to fix this issue. Fixes: 8cb631c ("iio: Remove superfluous of_node assignments") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent db8f06d commit d53bfdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/meson_saradc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev)
707707
size_t read_len;
708708
int ret;
709709

710-
temperature_calib = devm_nvmem_cell_get(&indio_dev->dev,
710+
temperature_calib = devm_nvmem_cell_get(indio_dev->dev.parent,
711711
"temperature_calib");
712712
if (IS_ERR(temperature_calib)) {
713713
ret = PTR_ERR(temperature_calib);

0 commit comments

Comments
 (0)