[PATCH] iio: adc: ti-ads131e08: return correct error code

Dixit Parmar posted 1 patch 2 months, 1 week ago
drivers/iio/adc/ti-ads131e08.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] iio: adc: ti-ads131e08: return correct error code
Posted by Dixit Parmar 2 months, 1 week ago
The error code returned from devm_iio_trigger_register() inturn
iio_trigger_register() can be other than -ENOMEM. Hence return the
same value as it was returned from the function call.
This change makes devm_iio_trigger_register() handling uniform with
other iio drivers.

Signed-off-by: Dixit Parmar <dixitparmar19@gmail.com>
---
The error code returned from devm_iio_trigger_register() inturn
iio_trigger_register() can be other than -ENOMEM. Hence return the
same value as it was returned from the function call.
This change makes devm_iio_trigger_register() handling uniform with
other iio drivers.
---
 drivers/iio/adc/ti-ads131e08.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-ads131e08.c b/drivers/iio/adc/ti-ads131e08.c
index b18f30d3fdbe..10330d6913df 100644
--- a/drivers/iio/adc/ti-ads131e08.c
+++ b/drivers/iio/adc/ti-ads131e08.c
@@ -852,7 +852,7 @@ static int ads131e08_probe(struct spi_device *spi)
 	ret = devm_iio_trigger_register(&spi->dev, st->trig);
 	if (ret) {
 		dev_err(&spi->dev, "failed to register IIO trigger\n");
-		return -ENOMEM;
+		return ret;
 	}
 
 	indio_dev->trig = iio_trigger_get(st->trig);

---
base-commit: 07e27ad16399afcd693be20211b0dfae63e0615f
change-id: 20251011-ret_val-3186236b240f

Best regards,
-- 
Dixit Parmar <dixitparmar19@gmail.com>
Re: [PATCH] iio: adc: ti-ads131e08: return correct error code
Posted by Jonathan Cameron 2 months, 1 week ago
On Sat, 11 Oct 2025 13:41:49 +0530
Dixit Parmar <dixitparmar19@gmail.com> wrote:

> The error code returned from devm_iio_trigger_register() inturn
> iio_trigger_register() can be other than -ENOMEM. Hence return the
> same value as it was returned from the function call.
> This change makes devm_iio_trigger_register() handling uniform with
> other iio drivers.
> 
> Signed-off-by: Dixit Parmar <dixitparmar19@gmail.com>
Applied

Thanks,

J
Re: [PATCH] iio: adc: ti-ads131e08: return correct error code
Posted by Markus Elfring 2 months, 1 week ago
…
> This change makes …

Will another imperative wording approach become more helpful for an improved
change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17#n94


How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17#n145

Regards,
Markus