From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Archit Anant <architanant5@gmail.com>
Cc: jic23@kernel.org, dlechner@baylibre.com, andy@kernel.org,
nuno.sa@analog.com, u.kleine-koenig@baylibre.com,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] iio: adc: ti-ads1015: convert to fully managed resources
Date: Sat, 18 Jul 2026 11:39:18 +0300 [thread overview]
Message-ID: <als7ttnvC7pIqvJk@ashevche-desk.local> (raw)
In-Reply-To: <20260718075016.27750-4-architanant5@gmail.com>
On Sat, Jul 18, 2026 at 01:20:16PM +0530, Archit Anant wrote:
> Refactor the driver to use devm_ allocations and power
> management, allowing for the complete removal of the
> ads1015_remove()
>
> Key changes:
> - Use devm_add_action_or_reset() to ensure the ADC is safely powered
> down upon driver removal.
> - Move to devm_pm_runtime_set_active_enabled() to manage the runtime
> PM lifecycle.
> - Update the PM operations to use DEFINE_RUNTIME_DEV_PM_OPS and
> pm_ptr() for modern compiler saftey.
> - Convert iio_device_register() and mutex_init() to their devm_
> variants.
> - Remove the thus obsolete ads1015_remove() function.
...
> +static void ads1015_power_off(void *data)
> +{
> + struct ads1015_data *st = data;
Unneeded.
> + /* power down single shot mode */
> + ads1015_set_conv_mode(st, ADS1015_SINGLESHOT);
> +}
/* power down single shot mode */
static void ads1015_power_off(void *st)
{
ads1015_set_conv_mode(st, ADS1015_SINGLESHOT);
}
...
> -static const struct dev_pm_ops ads1015_pm_ops = {
> - SET_RUNTIME_PM_OPS(ads1015_runtime_suspend,
> - ads1015_runtime_resume, NULL)
> -};
> +static DEFINE_RUNTIME_DEV_PM_OPS(ads1015_pm_ops,
> + ads1015_runtime_suspend,
> + ads1015_runtime_resume,
> + NULL);
> .driver = {
> .name = ADS1015_DRV_NAME,
> .of_match_table = ads1015_of_match,
> - .pm = &ads1015_pm_ops,
> + .pm = pm_ptr(&ads1015_pm_ops),
> },
This should be split to a separate change. Before even patch 1.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-07-18 8:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-18 7:50 [PATCH 0/3] iio: adc: ti-ads1015: modernize resource management Archit Anant
2026-07-18 7:50 ` [PATCH 1/3] iio: adc: ti-ads1015: sort headers alphabetically Archit Anant
2026-07-18 7:50 ` [PATCH 2/3] iio: adc: ti-ads1015: use local device pointer in probe Archit Anant
2026-07-18 8:37 ` Andy Shevchenko
2026-07-18 21:48 ` Jonathan Cameron
2026-07-18 7:50 ` [PATCH 3/3] iio: adc: ti-ads1015: convert to fully managed resources Archit Anant
2026-07-18 8:39 ` Andy Shevchenko [this message]
2026-07-18 21:55 ` Jonathan Cameron
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=als7ttnvC7pIqvJk@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=architanant5@gmail.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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