From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH 05/14] Input: samsung-keypad - use devm to disable runtime PM
Date: Mon, 19 Aug 2024 07:47:01 -0700 [thread overview]
Message-ID: <ZsNa5SmDyrAo_MXq@google.com> (raw)
In-Reply-To: <bkkh2as5v44nldhpnmswt7pssiude6ddci7v5nvzqhba6xxbnj@veoftlgrhu6p>
On Mon, Aug 19, 2024 at 02:54:39PM +0200, Krzysztof Kozlowski wrote:
> On Sun, Aug 18, 2024 at 09:58:02PM -0700, Dmitry Torokhov wrote:
> > To make sure that runtime PM is disabled at the right time relative
> > to all other devm-managed resources use devm_add_action_or_reset()
> > to register a handler that will disable it.
> >
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> > drivers/input/keyboard/samsung-keypad.c | 24 +++++++++++++-----------
> > 1 file changed, 13 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
> > index 7adcd2657bca..924327de4d8f 100644
> > --- a/drivers/input/keyboard/samsung-keypad.c
> > +++ b/drivers/input/keyboard/samsung-keypad.c
> > @@ -310,6 +310,13 @@ samsung_keypad_parse_dt(struct device *dev)
> > }
> > #endif
> >
> > +static void samsung_disable_runtime_pm(void *data)
> > +{
> > + struct samsung_keypad *keypad = data;
> > +
> > + pm_runtime_disable(&keypad->pdev->dev);
> > +}
> > +
> > static int samsung_keypad_probe(struct platform_device *pdev)
> > {
> > const struct samsung_keypad_platdata *pdata;
> > @@ -420,11 +427,16 @@ static int samsung_keypad_probe(struct platform_device *pdev)
> >
> > device_init_wakeup(&pdev->dev, pdata->wakeup);
> > platform_set_drvdata(pdev, keypad);
> > +
> > pm_runtime_enable(&pdev->dev);
> > + error = devm_add_action_or_reset(&pdev->dev, samsung_disable_runtime_pm,
> > + keypad);
> > + if (error)
> > + return error;
>
> I think you are open-coding devm_pm_runtime_enable().
Ah, I didn't realize we had it. Thanks!
--
Dmitry
next prev parent reply other threads:[~2024-08-19 14:47 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 4:57 [PATCH 00/14] Remove support for platform data from samsung keypad Dmitry Torokhov
2024-08-19 4:57 ` [PATCH 01/14] Input: samsung-keypad - switch to using devm_clk_get_prepared() Dmitry Torokhov
2024-08-19 12:51 ` Krzysztof Kozlowski
2024-08-19 14:46 ` Dmitry Torokhov
2024-08-19 4:57 ` [PATCH 02/14] Input: samsung-keypad - do not set input device's parent explicitly Dmitry Torokhov
2024-08-19 12:51 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 03/14] Input: samsung-keypad - do not combine memory allocation checks Dmitry Torokhov
2024-08-19 12:52 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 04/14] Input: samsung-keypad - use struct_size() helper Dmitry Torokhov
2024-08-19 12:52 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 05/14] Input: samsung-keypad - use devm to disable runtime PM Dmitry Torokhov
2024-08-19 12:54 ` Krzysztof Kozlowski
2024-08-19 14:47 ` Dmitry Torokhov [this message]
2024-08-19 4:58 ` [PATCH 06/14] Input: samsung-keypad - use guard notation to acquire mutex Dmitry Torokhov
2024-08-22 15:48 ` Krzysztof Kozlowski
2024-08-22 18:07 ` Dmitry Torokhov
2024-08-23 6:06 ` Krzysztof Kozlowski
2024-08-23 8:32 ` Dmitry Torokhov
2024-08-23 8:52 ` Krzysztof Kozlowski
2024-08-23 15:41 ` Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 07/14] Input: samsung-keypad - use per-chip parameters Dmitry Torokhov
2024-08-19 12:57 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 08/14] Input: samsung-keypad - use BIT() and GENMASK() where appropriate Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 09/14] dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding Dmitry Torokhov
2024-08-19 13:02 ` Krzysztof Kozlowski
2024-08-19 15:49 ` Dmitry Torokhov
2024-08-19 16:48 ` Conor Dooley
2024-08-19 17:14 ` Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 10/14] Input: samsung-keypad - handle " Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 11/14] ARM: s3c: crag6410: switch keypad device to software properties Dmitry Torokhov
2024-08-22 15:41 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 12/14] Input: samsung-keypad - remove support for platform data Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 13/14] ARM: s3c: crag6410: use software nodes/properties to set up GPIO keys Dmitry Torokhov
2024-08-22 15:50 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 14/14] ARM: s3c: crag6410 - convert GPIO lookup tables to property entries Dmitry Torokhov
2024-08-22 15:49 ` Krzysztof Kozlowski
2024-08-19 9:40 ` [PATCH 00/14] Remove support for platform data from samsung keypad Arnd Bergmann
2024-10-04 13:38 ` Dmitry Torokhov
2024-10-04 14:58 ` Mark Brown
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=ZsNa5SmDyrAo_MXq@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=patches@opensource.cirrus.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 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.