iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get
PATCH 1/1 iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get
There is absolutely no reason to pospone cleanup of this post driver removal. Just do it immediately.
--- drivers/iio/adc/at91-sama5d2_adc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/at91-sama5d2_adc.c +2 -1
@@ -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);
Signature · 1 line
2.53.0
Quoted 5 lines · Rosen Penev
There is absolutely no reason to pospone cleanup of this post driver removal. Just do it immediately.
Signed-off-by Rosen Penev <[email protected]>---
Quoted 5 lines · Rosen Penev
There is absolutely no reason to pospone cleanup of this post driver removal. Just do it immediately.
Signed-off-by Rosen Penev <[email protected]>---
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:
Quoted 24 lines
drivers/iio/adc/at91-sama5d2_adc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)drivers/iio/adc/at91-sama5d2_adc.c +0
-0@@ -2259,7 +2259,7 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st, return 0;
/* Get the calibration data from NVMEM. */drivers/iio/adc/at91-sama5d2_adc.c +1
-1- 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)drivers/iio/adc/at91-sama5d2_adc.c +0
-0@@ -2268,6 +2268,7 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st, }
buf =nvmem_cell_read(temp_calib, &len);drivers/iio/adc/at91-sama5d2_adc.c +1
-0+nvmem_cell_put (temp_calib);if (
IS_ERR(buf)) {
dev_err(dev, "Failed to read calibration data!\n"); returnPTR_ERR(buf);
Quoted 4 lines · On Tue, 3 Mar 2026 20:18:43 -0800 Rosen Penev <[email protected]> wrote:
There is absolutely no reason to pospone cleanup of this post driver removal. Just do it immediately.
Signed-off-by Rosen Penev <[email protected]>
Applied.
Thanks,
J