public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get
@ 2026-03-04  4:18 Rosen Penev
  2026-03-04  6:56 ` Eugen Hristev
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rosen Penev @ 2026-03-04  4:18 UTC (permalink / raw)
  To: linux-iio
  Cc: Eugen Hristev, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	moderated list:ARM/Microchip (AT91) SoC support, open list

There is absolutely no reason to pospone cleanup of this post driver
removal. Just do it immediately.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index 69bb49434f90..255970b2e747 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -2259,7 +2259,7 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st,
 		return 0;
 
 	/* Get the calibration data from NVMEM. */
-	temp_calib = devm_nvmem_cell_get(dev, "temperature_calib");
+	temp_calib = nvmem_cell_get(dev, "temperature_calib");
 	if (IS_ERR(temp_calib)) {
 		ret = PTR_ERR(temp_calib);
 		if (ret != -ENOENT)
@@ -2268,6 +2268,7 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st,
 	}
 
 	buf = nvmem_cell_read(temp_calib, &len);
+	nvmem_cell_put(temp_calib);
 	if (IS_ERR(buf)) {
 		dev_err(dev, "Failed to read calibration data!\n");
 		return PTR_ERR(buf);
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get
  2026-03-04  4:18 [PATCH] iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get Rosen Penev
@ 2026-03-04  6:56 ` Eugen Hristev
  2026-03-04 11:44 ` Nuno Sá
  2026-03-07 13:13 ` Jonathan Cameron
  2 siblings, 0 replies; 4+ messages in thread
From: Eugen Hristev @ 2026-03-04  6:56 UTC (permalink / raw)
  To: Rosen Penev, linux-iio
  Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	moderated list:ARM/Microchip (AT91) SoC support, open list



On 3/4/26 06:18, Rosen Penev wrote:
> There is absolutely no reason to pospone cleanup of this post driver
> removal. Just do it immediately.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---

Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get
  2026-03-04  4:18 [PATCH] iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get Rosen Penev
  2026-03-04  6:56 ` Eugen Hristev
@ 2026-03-04 11:44 ` Nuno Sá
  2026-03-07 13:13 ` Jonathan Cameron
  2 siblings, 0 replies; 4+ messages in thread
From: Nuno Sá @ 2026-03-04 11:44 UTC (permalink / raw)
  To: Rosen Penev, linux-iio
  Cc: Eugen Hristev, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	moderated list:ARM/Microchip (AT91) SoC support, open list

On Tue, 2026-03-03 at 20:18 -0800, Rosen Penev wrote:
> There is absolutely no reason to pospone cleanup of this post driver
> removal. Just do it immediately.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---

I guess we do not have that many users for nvmem_cell_get(), otherwise a new __free(nvmem_cell)
could make sense. Anyways not related:

Reviewed-by: Nuno Sá <nuno.sa@analog.com>

>  drivers/iio/adc/at91-sama5d2_adc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> index 69bb49434f90..255970b2e747 100644
> --- a/drivers/iio/adc/at91-sama5d2_adc.c
> +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> @@ -2259,7 +2259,7 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st,
>  		return 0;
>  
>  	/* Get the calibration data from NVMEM. */
> -	temp_calib = devm_nvmem_cell_get(dev, "temperature_calib");
> +	temp_calib = nvmem_cell_get(dev, "temperature_calib");
>  	if (IS_ERR(temp_calib)) {
>  		ret = PTR_ERR(temp_calib);
>  		if (ret != -ENOENT)
> @@ -2268,6 +2268,7 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st,
>  	}
>  
>  	buf = nvmem_cell_read(temp_calib, &len);
> +	nvmem_cell_put(temp_calib);
>  	if (IS_ERR(buf)) {
>  		dev_err(dev, "Failed to read calibration data!\n");
>  		return PTR_ERR(buf);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get
  2026-03-04  4:18 [PATCH] iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get Rosen Penev
  2026-03-04  6:56 ` Eugen Hristev
  2026-03-04 11:44 ` Nuno Sá
@ 2026-03-07 13:13 ` Jonathan Cameron
  2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2026-03-07 13:13 UTC (permalink / raw)
  To: Rosen Penev
  Cc: linux-iio, Eugen Hristev, David Lechner, Nuno Sá,
	Andy Shevchenko, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	moderated list:ARM/Microchip (AT91) SoC support, open list

On Tue,  3 Mar 2026 20:18:43 -0800
Rosen Penev <rosenp@gmail.com> wrote:

> There is absolutely no reason to pospone cleanup of this post driver
> removal. Just do it immediately.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
Applied.

Thanks,

J


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-07 13:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-04  4:18 [PATCH] iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get Rosen Penev
2026-03-04  6:56 ` Eugen Hristev
2026-03-04 11:44 ` Nuno Sá
2026-03-07 13:13 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox