public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Kurt Borja <kuurtb@gmail.com>,
	platform-driver-x86@vger.kernel.org,  W_Armin@gmx.de,
	Hans de Goede <hdegoede@redhat.com>,
	lenb@kernel.org,  linux-acpi@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	 mario.limonciello@amd.com,
	Mark Pearson <mpearson-lenovo@squebb.ca>,
	 soyer@irl.hu
Subject: Re: [PATCH v2 1/2] ACPI: platform_profile: Add devm_platform_profile_register()
Date: Tue, 14 Jan 2025 16:33:25 +0200 (EET)	[thread overview]
Message-ID: <925e1bb3-f21a-553e-24ce-6ef09ef7b4e7@linux.intel.com> (raw)
In-Reply-To: <CAJZ5v0jRkDx1E+mW0dhD2f9Ow8GxeT-8AvYjcZOvoYC2+J07jg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2994 bytes --]

On Tue, 14 Jan 2025, Rafael J. Wysocki wrote:

> On Tue, Dec 24, 2024 at 3:02 PM Kurt Borja <kuurtb@gmail.com> wrote:
> >
> > Platform profile's lifetime is usually tied to a device's lifetime,
> > therefore add a device managed version of platform_profile_register().
> >
> > Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> 
> This is fine by me, so
> 
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> and I think that it would be better to route it via platform/x86 along
> with the second patch.

That's were it already is among the other platform profile changes.

We still have one big platform profile series pending (though Kurt needs 
to do small tweaks still into it before it can be applied):

https://lore.kernel.org/all/20250109150731.110799-1-kuurtb@gmail.com/

-- 
 i.

> > ---
> >  drivers/acpi/platform_profile.c  | 29 +++++++++++++++++++++++++++++
> >  include/linux/platform_profile.h |  1 +
> >  2 files changed, 30 insertions(+)
> >
> > diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> > index 75a1415190ac..4c4200a0b1a6 100644
> > --- a/drivers/acpi/platform_profile.c
> > +++ b/drivers/acpi/platform_profile.c
> > @@ -519,6 +519,35 @@ int platform_profile_remove(struct platform_profile_handler *pprof)
> >  }
> >  EXPORT_SYMBOL_GPL(platform_profile_remove);
> >
> > +static void devm_platform_profile_release(struct device *dev, void *res)
> > +{
> > +       struct platform_profile_handler **pprof = res;
> > +
> > +       platform_profile_remove(*pprof);
> > +}
> > +
> > +int devm_platform_profile_register(struct platform_profile_handler *pprof)
> > +{
> > +       struct platform_profile_handler **dr;
> > +       int ret;
> > +
> > +       dr = devres_alloc(devm_platform_profile_release, sizeof(*dr), GFP_KERNEL);
> > +       if (!dr)
> > +               return -ENOMEM;
> > +
> > +       ret = platform_profile_register(pprof);
> > +       if (ret) {
> > +               devres_free(dr);
> > +               return ret;
> > +       }
> > +
> > +       *dr = pprof;
> > +       devres_add(pprof->dev, dr);
> > +
> > +       return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(devm_platform_profile_register);
> > +
> >  static int __init platform_profile_init(void)
> >  {
> >         int err;
> > diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
> > index 0682bb4c57e5..f1cd4b65e351 100644
> > --- a/include/linux/platform_profile.h
> > +++ b/include/linux/platform_profile.h
> > @@ -41,6 +41,7 @@ struct platform_profile_handler {
> >
> >  int platform_profile_register(struct platform_profile_handler *pprof);
> >  int platform_profile_remove(struct platform_profile_handler *pprof);
> > +int devm_platform_profile_register(struct platform_profile_handler *pprof);
> >  int platform_profile_cycle(void);
> >  void platform_profile_notify(struct platform_profile_handler *pprof);
> >
> > --
> > 2.47.1
> >
> 

  reply	other threads:[~2025-01-14 14:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-24 14:01 [PATCH v2 0/2] Device managed platform_profile_register() Kurt Borja
2024-12-24 14:01 ` [PATCH v2 1/2] ACPI: platform_profile: Add devm_platform_profile_register() Kurt Borja
2025-01-14 13:34   ` Rafael J. Wysocki
2025-01-14 14:33     ` Ilpo Järvinen [this message]
2024-12-24 14:01 ` [PATCH v2 2/2] alienware-wmi: Use devm_platform_profile_register() Kurt Borja
2024-12-25 20:31 ` [PATCH v2 0/2] Device managed platform_profile_register() Armin Wolf
2024-12-30 18:31 ` Ilpo Järvinen
2024-12-31 15:53   ` Kurt Borja
2025-01-07 15:48     ` Ilpo Järvinen

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=925e1bb3-f21a-553e-24ce-6ef09ef7b4e7@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=W_Armin@gmx.de \
    --cc=hdegoede@redhat.com \
    --cc=kuurtb@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=soyer@irl.hu \
    /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