All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Using dev_err_probe as it simplifies error handling and ensures consistent error reporting.
@ 2026-06-20 17:40 Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 1/5] iio: adc: ti-adc081c: use dev_err_probe for probe time error Prashant Rahul
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Prashant Rahul @ 2026-06-20 17:40 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Shuah Khan, Prashant Rahul, David Lechner, Nuno Sá,
	Andy Shevchenko, Petr Mladek, Oleg Nesterov,
	Sebastian Andrzej Siewior, John Ogness, linux-kernel

Errors are logged when enabling the regulator or adding the cleanup action
fails, but not when buffer setup fails. This adds that missing log.

changes in v2:
- ti-adc084s021: drop unnecessary braces around single statement if block

v1: https://lore.kernel.org/linux-iio/20260618231543.413771-1-prashantrahul23@gmail.com/

Prashant Rahul (5):
  iio: adc: ti-adc081c: use dev_err_probe for probe time error
  iio: adc: ti-adc084s021: use dev_err_probe for probe time error
  iio: adc: ti-adc108s102: log buffer setup failure in probe
  iio: adc: ti-adc161s626: log buffer setup failure in probe
  iio: adc: ti-adc0832: log buffer setup failure in probe

 drivers/iio/adc/ti-adc081c.c    | 6 ++----
 drivers/iio/adc/ti-adc0832.c    | 2 +-
 drivers/iio/adc/ti-adc084s021.c | 6 ++----
 drivers/iio/adc/ti-adc108s102.c | 2 +-
 drivers/iio/adc/ti-adc161s626.c | 2 +-
 5 files changed, 7 insertions(+), 11 deletions(-)

--
2.54.0

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

* [PATCH v2 1/5] iio: adc: ti-adc081c: use dev_err_probe for probe time error
  2026-06-20 17:40 [PATCH v2 0/5] Using dev_err_probe as it simplifies error handling and ensures consistent error reporting Prashant Rahul
@ 2026-06-20 17:40 ` Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 2/5] iio: adc: ti-adc084s021: " Prashant Rahul
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Prashant Rahul @ 2026-06-20 17:40 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Shuah Khan, Prashant Rahul, David Lechner, Nuno Sá,
	Andy Shevchenko, Petr Mladek, Oleg Nesterov,
	Sebastian Andrzej Siewior, John Ogness, linux-kernel

This simplifies error handling and ensures consistent error reporting.

Signed-off-by: Prashant Rahul <prashantrahul23@gmail.com>
---
 drivers/iio/adc/ti-adc081c.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/ti-adc081c.c b/drivers/iio/adc/ti-adc081c.c
index 33f82bdfeb94..29dd7cf25f79 100644
--- a/drivers/iio/adc/ti-adc081c.c
+++ b/drivers/iio/adc/ti-adc081c.c
@@ -190,10 +190,8 @@ static int adc081c_probe(struct i2c_client *client)
 
 	err = devm_iio_triggered_buffer_setup(&client->dev, iio, NULL,
 					      adc081c_trigger_handler, NULL);
-	if (err < 0) {
-		dev_err(&client->dev, "iio triggered buffer setup failed\n");
-		return err;
-	}
+	if (err < 0)
+		return dev_err_probe(&client->dev, err, "iio triggered buffer setup failed\n");
 
 	return devm_iio_device_register(&client->dev, iio);
 }
-- 
2.54.0


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

* [PATCH v2 2/5] iio: adc: ti-adc084s021: use dev_err_probe for probe time error
  2026-06-20 17:40 [PATCH v2 0/5] Using dev_err_probe as it simplifies error handling and ensures consistent error reporting Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 1/5] iio: adc: ti-adc081c: use dev_err_probe for probe time error Prashant Rahul
@ 2026-06-20 17:40 ` Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 3/5] iio: adc: ti-adc108s102: log buffer setup failure in probe Prashant Rahul
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Prashant Rahul @ 2026-06-20 17:40 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Shuah Khan, Prashant Rahul, David Lechner, Nuno Sá,
	Andy Shevchenko, Petr Mladek, Oleg Nesterov,
	Sebastian Andrzej Siewior, John Ogness, linux-kernel

This simplifies error handling and ensures consistent error reporting.

Signed-off-by: Prashant Rahul <prashantrahul23@gmail.com>
---
 drivers/iio/adc/ti-adc084s021.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/ti-adc084s021.c b/drivers/iio/adc/ti-adc084s021.c
index a100f770fa1c..2b4bd223d816 100644
--- a/drivers/iio/adc/ti-adc084s021.c
+++ b/drivers/iio/adc/ti-adc084s021.c
@@ -229,10 +229,8 @@ static int adc084s021_probe(struct spi_device *spi)
 	ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL,
 					    adc084s021_buffer_trigger_handler,
 					    &adc084s021_buffer_setup_ops);
-	if (ret) {
-		dev_err(&spi->dev, "Failed to setup triggered buffer\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&spi->dev, ret, "Failed to setup triggered buffer\n");
 
 	return devm_iio_device_register(&spi->dev, indio_dev);
 }
-- 
2.54.0


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

* [PATCH v2 3/5] iio: adc: ti-adc108s102: log buffer setup failure in probe
  2026-06-20 17:40 [PATCH v2 0/5] Using dev_err_probe as it simplifies error handling and ensures consistent error reporting Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 1/5] iio: adc: ti-adc081c: use dev_err_probe for probe time error Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 2/5] iio: adc: ti-adc084s021: " Prashant Rahul
@ 2026-06-20 17:40 ` Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 4/5] iio: adc: ti-adc161s626: " Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 5/5] iio: adc: ti-adc0832: " Prashant Rahul
  4 siblings, 0 replies; 6+ messages in thread
From: Prashant Rahul @ 2026-06-20 17:40 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Shuah Khan, Prashant Rahul, David Lechner, Nuno Sá,
	Andy Shevchenko, Petr Mladek, Oleg Nesterov,
	Sebastian Andrzej Siewior, John Ogness, linux-kernel

Errors are logged when enabling the regulator or adding the cleanup
action fails, but not when buffer setup fails. Log the error returned by
the buffer setup path as well.

Signed-off-by: Prashant Rahul <prashantrahul23@gmail.com>
---
 drivers/iio/adc/ti-adc108s102.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-adc108s102.c b/drivers/iio/adc/ti-adc108s102.c
index 7d615e2bbf39..440afe584f5d 100644
--- a/drivers/iio/adc/ti-adc108s102.c
+++ b/drivers/iio/adc/ti-adc108s102.c
@@ -256,7 +256,7 @@ static int adc108s102_probe(struct spi_device *spi)
 					      &adc108s102_trigger_handler,
 					      NULL);
 	if (ret)
-		return ret;
+		return dev_err_probe(&spi->dev, ret, "iio triggered buffer setup failed\n");
 
 	ret = devm_iio_device_register(&spi->dev, indio_dev);
 	if (ret)
-- 
2.54.0


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

* [PATCH v2 4/5] iio: adc: ti-adc161s626: log buffer setup failure in probe
  2026-06-20 17:40 [PATCH v2 0/5] Using dev_err_probe as it simplifies error handling and ensures consistent error reporting Prashant Rahul
                   ` (2 preceding siblings ...)
  2026-06-20 17:40 ` [PATCH v2 3/5] iio: adc: ti-adc108s102: log buffer setup failure in probe Prashant Rahul
@ 2026-06-20 17:40 ` Prashant Rahul
  2026-06-20 17:40 ` [PATCH v2 5/5] iio: adc: ti-adc0832: " Prashant Rahul
  4 siblings, 0 replies; 6+ messages in thread
From: Prashant Rahul @ 2026-06-20 17:40 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Shuah Khan, Prashant Rahul, David Lechner, Nuno Sá,
	Andy Shevchenko, Petr Mladek, Oleg Nesterov,
	Sebastian Andrzej Siewior, John Ogness, linux-kernel

Errors are logged when enabling the regulator or adding the cleanup
action fails, but not when buffer setup fails. Log the error returned by
the buffer setup path as well.

Signed-off-by: Prashant Rahul <prashantrahul23@gmail.com>
---
 drivers/iio/adc/ti-adc161s626.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c
index be1cc2e77862..f83073280c9c 100644
--- a/drivers/iio/adc/ti-adc161s626.c
+++ b/drivers/iio/adc/ti-adc161s626.c
@@ -217,7 +217,7 @@ static int ti_adc_probe(struct spi_device *spi)
 	ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL,
 					      ti_adc_trigger_handler, NULL);
 	if (ret)
-		return ret;
+		return dev_err_probe(&spi->dev, ret, "iio triggered buffer setup failed\n");
 
 	return devm_iio_device_register(&spi->dev, indio_dev);
 }
-- 
2.54.0


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

* [PATCH v2 5/5] iio: adc: ti-adc0832: log buffer setup failure in probe
  2026-06-20 17:40 [PATCH v2 0/5] Using dev_err_probe as it simplifies error handling and ensures consistent error reporting Prashant Rahul
                   ` (3 preceding siblings ...)
  2026-06-20 17:40 ` [PATCH v2 4/5] iio: adc: ti-adc161s626: " Prashant Rahul
@ 2026-06-20 17:40 ` Prashant Rahul
  4 siblings, 0 replies; 6+ messages in thread
From: Prashant Rahul @ 2026-06-20 17:40 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Shuah Khan, Prashant Rahul, David Lechner, Nuno Sá,
	Andy Shevchenko, Petr Mladek, Oleg Nesterov,
	Sebastian Andrzej Siewior, John Ogness, linux-kernel

Errors are logged when enabling the regulator or adding the cleanup
action fails, but not when buffer setup fails. Log the error returned by
the buffer setup path as well.

Signed-off-by: Prashant Rahul <prashantrahul23@gmail.com>
---
 drivers/iio/adc/ti-adc0832.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-adc0832.c b/drivers/iio/adc/ti-adc0832.c
index cfcdafbe284b..417e54223092 100644
--- a/drivers/iio/adc/ti-adc0832.c
+++ b/drivers/iio/adc/ti-adc0832.c
@@ -299,7 +299,7 @@ static int adc0832_probe(struct spi_device *spi)
 	ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL,
 					      adc0832_trigger_handler, NULL);
 	if (ret)
-		return ret;
+		return dev_err_probe(&spi->dev, ret, "iio triggered buffer setup failed\n");
 
 	return devm_iio_device_register(&spi->dev, indio_dev);
 }
-- 
2.54.0


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

end of thread, other threads:[~2026-06-20 17:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-20 17:40 [PATCH v2 0/5] Using dev_err_probe as it simplifies error handling and ensures consistent error reporting Prashant Rahul
2026-06-20 17:40 ` [PATCH v2 1/5] iio: adc: ti-adc081c: use dev_err_probe for probe time error Prashant Rahul
2026-06-20 17:40 ` [PATCH v2 2/5] iio: adc: ti-adc084s021: " Prashant Rahul
2026-06-20 17:40 ` [PATCH v2 3/5] iio: adc: ti-adc108s102: log buffer setup failure in probe Prashant Rahul
2026-06-20 17:40 ` [PATCH v2 4/5] iio: adc: ti-adc161s626: " Prashant Rahul
2026-06-20 17:40 ` [PATCH v2 5/5] iio: adc: ti-adc0832: " Prashant Rahul

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.