From: William Breathitt Gray <wbg@kernel.org>
To: Stepan Ionichev <sozdayvek@gmail.com>
Cc: William Breathitt Gray <wbg@kernel.org>,
m32285159@gmail.com, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] counter: ti-eqep: use devm for runtime PM to fix probe error path
Date: Thu, 4 Jun 2026 11:19:01 +0900 [thread overview]
Message-ID: <20260604021902.891327-1-wbg@kernel.org> (raw)
In-Reply-To: <20260529095834.2561-1-sozdayvek@gmail.com>
On Fri, May 29, 2026 at 02:58:34PM +0500, Stepan Ionichev wrote:
> err = counter_add(counter);
> - if (err < 0) {
> - pm_runtime_put_sync(dev);
> - pm_runtime_disable(dev);
> - return err;
> - }
> + if (err < 0)
> + return dev_err_probe(dev, err, "Failed to add counter\n");
>
> return 0;
> }
> @@ -564,11 +575,8 @@ static int ti_eqep_probe(struct platform_device *pdev)
> static void ti_eqep_remove(struct platform_device *pdev)
> {
> struct counter_device *counter = platform_get_drvdata(pdev);
> - struct device *dev = &pdev->dev;
>
> counter_unregister(counter);
> - pm_runtime_put_sync(dev);
> - pm_runtime_disable(dev);
> }
The ti_eqep_remove() callback can go away entirely if you use
devm_counter_add() to replace counter_add(). It's not really part of
this PM fix, but it is a nice clean up to simplify the code if you would
like to add a subsequent patch doing so after the PM fix.
William Breathitt Gray
prev parent reply other threads:[~2026-06-04 2:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 9:58 [PATCH v3] counter: ti-eqep: use devm for runtime PM to fix probe error path Stepan Ionichev
2026-06-03 5:42 ` Andy Shevchenko
2026-06-04 2:19 ` William Breathitt Gray [this message]
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=20260604021902.891327-1-wbg@kernel.org \
--to=wbg@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m32285159@gmail.com \
--cc=nuno.sa@analog.com \
--cc=sozdayvek@gmail.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