From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Maxime Ripard" <mripard@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
u.kleine-koenig@baylibre.com, linux-iio@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 5/8] iio: adc: at91_adc: use local struct device pointer in probe
Date: Fri, 4 Dec 2026 11:21:11 +0200 [thread overview]
Message-ID: <axKGB4dS8fKE8Jnq@ashevche-desk.local> (raw)
In-Reply-To: <20261203-at91-adc-v6-v6-5-bfa754299f54@gmail.com>
On Thu, Dec 03, 2026 at 07:30:09PM +0200, Abdelnasser Hussein wrote:
> Convert the remaining &pdev->dev and &idev->dev uses in at91_adc_probe()
> to the local dev pointer, and pass sizeof(*st) to
> devm_iio_device_alloc().
>
> Diagnostics that previously used &idev->dev now use the platform device.
Is this equivalent or not? It's unclear.
...
> if (st->caps->has_tsmr)
> - ret = devm_request_irq(&pdev->dev, st->irq,
> + ret = devm_request_irq(dev, st->irq,
> at91_adc_9x5_interrupt, 0,
> - pdev->dev.driver->name, idev);
> + dev->driver->name, idev);
> else
> - ret = devm_request_irq(&pdev->dev, st->irq,
> + ret = devm_request_irq(dev, st->irq,
> at91_adc_rl_interrupt, 0,
> - pdev->dev.driver->name, idev);
> + dev->driver->name, idev);
> if (ret)
> return ret;
Can be reshaped
if (st->caps->has_tsmr)
ret = devm_request_irq(dev, st->irq, at91_adc_9x5_interrupt, 0,
dev->driver->name, idev);
else
ret = devm_request_irq(dev, st->irq, at91_adc_rl_interrupt, 0,
dev->driver->name, idev);
if (ret)
return ret;
...
> - return dev_err_probe(&pdev->dev, -EINVAL,
> + return dev_err_probe(dev, -EINVAL,
> "No startup time available.\n");
Can be a single line now.
return dev_err_probe(dev, -EINVAL, "No startup time available.\n");
...
> ret = at91_adc_trigger_init(idev);
> if (ret < 0) {
> - dev_err(&pdev->dev, "Couldn't setup the triggers.\n");
> + dev_err(dev, "Couldn't setup the triggers.\n");
It should be dev_err_probe().
> at91_adc_buffer_remove(idev);
> return ret;
> }
...
> ret = iio_device_register(idev);
> if (ret < 0) {
> - dev_err(&pdev->dev, "Couldn't register the device.\n");
> + dev_err(dev, "Couldn't register the device.\n");
It should be dev_err_probe().
> goto error_iio_device_register;
And here is something fishy as we usually don't have goto:s in devm_*() enabled
probe. But if the order is followed, then we are okay.
> }
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-12-04 9:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 17:30 [PATCH v6 0/8] iio: adc: at91_adc: fix NULL trigger dereference and convert to devm Abdelnasser Hussein
2026-12-03 17:30 ` [PATCH v6 1/8] iio: adc: at91_adc: skip unpopulated triggers on teardown Abdelnasser Hussein
2026-12-03 17:53 ` Andy Shevchenko
2026-12-03 17:30 ` [PATCH v6 2/8] iio: adc: at91_adc: drop duplicate IRQ allocation error message Abdelnasser Hussein
2026-12-03 17:30 ` [PATCH v6 3/8] iio: adc: at91_adc: switch to device_get_match_data() Abdelnasser Hussein
2026-12-03 17:55 ` Andy Shevchenko
2026-12-03 17:30 ` [PATCH v6 4/8] iio: adc: at91_adc: convert to device_property_*() APIs Abdelnasser Hussein
2026-12-03 17:57 ` Andy Shevchenko
2026-12-03 17:30 ` [PATCH v6 5/8] iio: adc: at91_adc: use local struct device pointer in probe Abdelnasser Hussein
2026-12-04 9:21 ` Andy Shevchenko [this message]
2026-12-04 9:44 ` Andy Shevchenko
2026-12-03 17:30 ` [PATCH v6 6/8] iio: adc: at91_adc: pass struct device to at91_ts_register() Abdelnasser Hussein
2026-12-04 9:40 ` Andy Shevchenko
2026-12-03 17:30 ` [PATCH v6 7/8] iio: adc: at91_adc: use HZ_PER_KHZ instead of raw 1000 Abdelnasser Hussein
2026-12-04 9:41 ` Andy Shevchenko
2026-12-04 14:33 ` David Laight
2026-12-04 14:51 ` Andy Shevchenko
2026-12-05 11:53 ` David Laight
2026-12-03 17:30 ` [PATCH v6 8/8] iio: adc: at91_adc: convert to device-managed resources Abdelnasser Hussein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=axKGB4dS8fKE8Jnq@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=abdelnasserhussein11@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andy@kernel.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=dlechner@baylibre.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=nuno.sa@analog.com \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®