From: Jonathan Cameron <jic23@kernel.org>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: lars@metafoo.de, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, knaack.h@gmx.de,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH for-5.9] iio: adc: meson-saradc: Use the parent device to look up the calib data
Date: Sat, 22 Aug 2020 11:40:36 +0100 [thread overview]
Message-ID: <20200822114036.49199bff@archlinux> (raw)
In-Reply-To: <20200815181355.407034-1-martin.blumenstingl@googlemail.com>
On Sat, 15 Aug 2020 20:13:55 +0200
Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:
> 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 8cb631ccbb1952
> ("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: 8cb631ccbb1952 ("iio: Remove superfluous of_node assignments")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Gah. I hope we don't have too many more non obvious cases like
this hiding.
Applied to the fixes-togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/adc/meson_saradc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
> index 93c2252c0b89..1a9189ba69ae 100644
> --- a/drivers/iio/adc/meson_saradc.c
> +++ b/drivers/iio/adc/meson_saradc.c
> @@ -707,7 +707,7 @@ static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev)
> size_t read_len;
> int ret;
>
> - temperature_calib = devm_nvmem_cell_get(&indio_dev->dev,
> + temperature_calib = devm_nvmem_cell_get(indio_dev->dev.parent,
> "temperature_calib");
> if (IS_ERR(temperature_calib)) {
> ret = PTR_ERR(temperature_calib);
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: lars@metafoo.de, linux-iio@vger.kernel.org,
linux-amlogic@lists.infradead.org, knaack.h@gmx.de,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH for-5.9] iio: adc: meson-saradc: Use the parent device to look up the calib data
Date: Sat, 22 Aug 2020 11:40:36 +0100 [thread overview]
Message-ID: <20200822114036.49199bff@archlinux> (raw)
In-Reply-To: <20200815181355.407034-1-martin.blumenstingl@googlemail.com>
On Sat, 15 Aug 2020 20:13:55 +0200
Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:
> 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 8cb631ccbb1952
> ("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: 8cb631ccbb1952 ("iio: Remove superfluous of_node assignments")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Gah. I hope we don't have too many more non obvious cases like
this hiding.
Applied to the fixes-togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/adc/meson_saradc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
> index 93c2252c0b89..1a9189ba69ae 100644
> --- a/drivers/iio/adc/meson_saradc.c
> +++ b/drivers/iio/adc/meson_saradc.c
> @@ -707,7 +707,7 @@ static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev)
> size_t read_len;
> int ret;
>
> - temperature_calib = devm_nvmem_cell_get(&indio_dev->dev,
> + temperature_calib = devm_nvmem_cell_get(indio_dev->dev.parent,
> "temperature_calib");
> if (IS_ERR(temperature_calib)) {
> ret = PTR_ERR(temperature_calib);
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: lars@metafoo.de, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, knaack.h@gmx.de,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH for-5.9] iio: adc: meson-saradc: Use the parent device to look up the calib data
Date: Sat, 22 Aug 2020 11:40:36 +0100 [thread overview]
Message-ID: <20200822114036.49199bff@archlinux> (raw)
In-Reply-To: <20200815181355.407034-1-martin.blumenstingl@googlemail.com>
On Sat, 15 Aug 2020 20:13:55 +0200
Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:
> 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 8cb631ccbb1952
> ("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: 8cb631ccbb1952 ("iio: Remove superfluous of_node assignments")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Gah. I hope we don't have too many more non obvious cases like
this hiding.
Applied to the fixes-togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/adc/meson_saradc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
> index 93c2252c0b89..1a9189ba69ae 100644
> --- a/drivers/iio/adc/meson_saradc.c
> +++ b/drivers/iio/adc/meson_saradc.c
> @@ -707,7 +707,7 @@ static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev)
> size_t read_len;
> int ret;
>
> - temperature_calib = devm_nvmem_cell_get(&indio_dev->dev,
> + temperature_calib = devm_nvmem_cell_get(indio_dev->dev.parent,
> "temperature_calib");
> if (IS_ERR(temperature_calib)) {
> ret = PTR_ERR(temperature_calib);
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-08-22 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-15 18:13 [PATCH for-5.9] iio: adc: meson-saradc: Use the parent device to look up the calib data Martin Blumenstingl
2020-08-15 18:13 ` Martin Blumenstingl
2020-08-15 18:13 ` Martin Blumenstingl
2020-08-22 10:40 ` Jonathan Cameron [this message]
2020-08-22 10:40 ` Jonathan Cameron
2020-08-22 10:40 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200822114036.49199bff@archlinux \
--to=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.