Skip to contentSkip to conversation

iio: adc: ad7779: Remove dead code and redundant error message

PATCH Superseded Moksh Panicker 3 participants 9 messages Jun 28 – Jul 1

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover iio: adc: ad7779: Remove dead code and redundant error message

These two patches address review feedback from Joshua Crofts on the ad7779 driver:

1. Remove an unused completion field that was initialized but never waited on or signaled anywhere in the driver.

2. Remove a redundant dev_err_probe() wrapper around devm_request_irq(), which already calls dev_err_probe() internally.

Moksh Panicker (2):
iio: adc: ad7779: Remove unused completion field
iio: adc: ad7779: Remove redundant dev_err_probe() after
devm_request_irq()

 drivers/iio/adc/ad7779.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/2 iio: adc: ad7779: Remove unused completion field

struct ad7779_state contains a completion field that is initialized in ad7779_setup_without_backend() but never waited on or signaled anywhere in the driver. Remove the dead code.

---
 drivers/iio/adc/ad7779.c | 2 --
 1 file changed, 2 deletions(-)
drivers/iio/adc/ad7779.c +0 -2
index 695cc79e78da..c1a99b4c1256 100644
@@ -143,7 +143,6 @@ struct ad7779_state {
 	const struct ad7779_chip_info *chip_info;
 	struct clk *mclk;
 	struct iio_trigger *trig;
-	struct completion completion;
 	unsigned int sampling_freq;
 	enum ad7779_filter filter_enabled;
 	struct iio_backend *back;
@@ -852,7 +851,6 @@ static int ad7779_setup_without_backend(struct ad7779_state *st, struct iio_dev
 
 	indio_dev->trig = iio_trigger_get(st->trig);
 
-	init_completion(&st->completion);
 
 	ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
 					      &iio_pollfunc_store_time,
Signature · 1 line
2.34.1
maintainer
#2 lore raw

Re: [PATCH v2 1/2] iio: adc: ad7779: Remove unused completion field

Quoted 23 lines · On Sun, 28 Jun 2026 14:57:33 +0000 Moksh Panicker <[email protected]>…

struct ad7779_state contains a completion field that is initialized in ad7779_setup_without_backend() but never waited on or signaled anywhere in the driver. Remove the dead code.

---
 drivers/iio/adc/ad7779.c | 2 --
 1 file changed, 2 deletions(-)
drivers/iio/adc/ad7779.c +0 -1
index 695cc79e78da..c1a99b4c1256 100644
@@ -143,7 +143,6 @@ struct ad7779_state {
 	const struct ad7779_chip_info *chip_info;
 	struct clk *mclk;
 	struct iio_trigger *trig;
-	struct completion completion;
 	unsigned int sampling_freq;
 	enum ad7779_filter filter_enabled;
 	struct iio_backend *back;

drivers/iio/adc/ad7779.c static int ad7779_setup_without_backend(struct ad7779_state *st, struct iio_dev · line 855

Quoted 4 lines
drivers/iio/adc/ad7779.c +0 -1
@@ -852,7 +851,6 @@ static int ad7779_setup_without_backend(struct ad7779_state *st, struct iio_dev
 
 	indio_dev->trig = iio_trigger_get(st->trig);
 
-	init_completion(&st->completion);

This will leave a pair of blank lines. Delete one of those as well.

I'd have fed that back to v1 if I'd gotten to it before you send v2. (see reply to cover letter about slowing down a little!)

Jonathan

Quoted 3 lines
drivers/iio/adc/ad7779.c +0 -0
 	ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
 					      &iio_pollfunc_store_time,
#3 lore raw

PATCH v2 2/2 iio: adc: ad7779: Remove redundant dev_err_probe() after devm_request_irq()

In reply to Moksh Panicker

devm_request_irq() already prints an error message on failure via the IRQ core, so wrapping its return value in dev_err_probe() results in a duplicate error message. Return the error directly instead.

---
 drivers/iio/adc/ad7779.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/adc/ad7779.c +1 -2
index c1a99b4c1256..a5b8bfa99a74 100644
@@ -842,8 +842,7 @@ static int ad7779_setup_without_backend(struct ad7779_state *st, struct iio_dev
 			       IRQF_NO_THREAD | IRQF_NO_AUTOEN, indio_dev->name,
 			       st->trig);
 	if (ret)
-		return dev_err_probe(dev, ret, "request IRQ %d failed\n",
-				     st->spi->irq);
+		return ret;
 
 	ret = devm_iio_trigger_register(dev, st->trig);
 	if (ret)
Signature · 1 line
2.34.1
Reviewed-by on the v2 series
#4 lore raw
In reply to Moksh Panicker
Quoted 9 lines · On Sun, 28 Jun 2026 14:57:32 +0000 Moksh Panicker <[email protected]>…

These two patches address review feedback from Joshua Crofts on the ad7779 driver:

1. Remove an unused completion field that was initialized but never waited on or signaled anywhere in the driver.

2. Remove a redundant dev_err_probe() wrapper around devm_request_irq(), which already calls dev_err_probe() internally.

Quoted 8 lines

Moksh Panicker (2):
iio: adc: ad7779: Remove unused completion field
iio: adc: ad7779: Remove redundant dev_err_probe() after
devm_request_irq()

 drivers/iio/adc/ad7779.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

You forgot to pull my Reviewed-by tags, no need to resend:

Signature · 3 lines
Kind regards

CJD
maintainer
#5 lore raw
Quoted 17 lines · On Sun, 28 Jun 2026 19:13:50 +0200 Joshua Crofts <[email protected]>…
Quoted 14 lines · On Sun, 28 Jun 2026 14:57:32 +0000 Moksh Panicker <[email protected]>…

These two patches address review feedback from Joshua Crofts on the ad7779 driver:

1. Remove an unused completion field that was initialized but never waited on or signaled anywhere in the driver.

2. Remove a redundant dev_err_probe() wrapper around devm_request_irq(), which already calls dev_err_probe() internally.

Moksh Panicker (2):
iio: adc: ad7779: Remove unused completion field
iio: adc: ad7779: Remove redundant dev_err_probe() after
devm_request_irq()

Quoted 7 lines
Quoted 3 lines
 drivers/iio/adc/ad7779.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

You forgot to pull my Reviewed-by tags, no need to resend:

Hi Moksh,

Generally slow down a little. You may well have gotten additional review on v1 if you'd waited longer and save both a little of your time and that of reviewers.

For even a simple series like this I'd wait a few days, or better still 1 week between early versions. It gets more relaxed if the code is already well reviewed and we are just dealing with final tweaks.

Thanks,

Jonathan

#6 lore raw

Thanks for the feedback, I'll fix the blank line and wait before sending v3.

Quoted 45 lines · Jonathan Cameron
Quoted 17 lines · On Sun, 28 Jun 2026 19:13:50 +0200 Joshua Crofts <[email protected]>…
Quoted 14 lines · On Sun, 28 Jun 2026 14:57:32 +0000 Moksh Panicker <[email protected]>…

These two patches address review feedback from Joshua Crofts on the ad7779 driver:

1. Remove an unused completion field that was initialized but never waited on or signaled anywhere in the driver.

2. Remove a redundant dev_err_probe() wrapper around devm_request_irq(), which already calls dev_err_probe() internally.

Moksh Panicker (2):
iio: adc: ad7779: Remove unused completion field
iio: adc: ad7779: Remove redundant dev_err_probe() after
devm_request_irq()

Quoted 7 lines
Quoted 3 lines
 drivers/iio/adc/ad7779.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

You forgot to pull my Reviewed-by tags, no need to resend:

Hi Moksh,

Generally slow down a little. You may well have gotten additional review on v1 if you'd waited longer and save both a little of your time and that of reviewers.

For even a simple series like this I'd wait a few days, or better still 1 week between early versions. It gets more relaxed if the code is already well reviewed and we are just dealing with final tweaks.

Thanks,

Jonathan

#7 lore raw
Quoted 1 line · On Tue, 30 Jun 2026 12:43:04 +0000 Moksh Panicker <[email protected]>…

Thanks for the feedback, I'll fix the blank line and wait before sending v3.

Also, please don't top-post!

Signature · 3 lines
Kind regards

CJD
maintainer
#8 lore raw
Quoted 7 lines · On Tue, 30 Jun 2026 14:53:27 +0200 Joshua Crofts <[email protected]>…
Quoted 1 line · On Tue, 30 Jun 2026 12:43:04 +0000 Moksh Panicker <[email protected]>…

Thanks for the feedback, I'll fix the blank line and wait before sending v3.

Also, please don't top-post!

Also please don't send replies to say you'll do what was suggested. That info should be in the change log for the next version (or in the case of the slow down reflected in slowing down ;) Replying like was done here just adds noise to the mailing list. It's a common mistake for new contributors so don't worry too much about it being pointed out to you specifically!

I've just sent a note on this to someone else and may be a little more grumpy than average as I'm about 450 emails behind on linux-iio and a lot more on other lists!

Jonathan