mbox series

[v3,00/19] Hide platform_profile_handler from consumers

Message ID 20250115071022.4815-1-kuurtb@gmail.com
Headers show
Series Hide platform_profile_handler from consumers | expand

Message

Kurt Borja Jan. 15, 2025, 7:10 a.m. UTC
Ilpo,

I left acer-wmi and hp-wmi class device variable names as is, on patch
15/19, because they are global variables and I believe `ppdev` is too
short for globals.

~ Kurt
---
v2 -> v3:

[01/19]
  - Dropped #include <linux/kdev_t.h>

[05/19]
  - Add dev_err log if probe fails
  - Log empty `choices` with dev_err
  - if (err < 0) -> if (err) when handling probe errors

[15/19]
  - Check if ppdev IS_ERR instead of dev in
    devm_platform_profile_register()
  - Drop pp_handler from alienware-wmi
  - Replace sanity check error log with WARN_ON_ONCE()
  - Add an intermediate variable `ppdev` to store
    &no_free_ptr(pprof)->class_dev right before we pass ownership to
    device_register()
  - Break lines better in all uses of devm_platform_profile_register()

[18/19]
  - Fixed kerneldoc for platform_profile_ops

[19/19]
  - Added

v2: https://lore.kernel.org/platform-driver-x86/20250114153726.11802-1-kuurtb@gmail.com/

Kurt Borja (19):
  ACPI: platform_profile: Replace *class_dev member with class_dev
  ACPI: platform_profile: Let drivers set drvdata to the class device
  ACPI: platform_profile: Remove platform_profile_handler from callbacks
  ACPI: platform_profile: Add `ops` member to handlers
  ACPI: platform_profile: Add `probe` to platform_profile_ops
  platform/surface: surface_platform_profile: Use
    devm_platform_profile_register()
  platform/x86: acer-wmi: Use devm_platform_profile_register()
  platform/x86: amd: pmf: sps: Use devm_platform_profile_register()
  platform/x86: asus-wmi: Use devm_platform_profile_register()
  platform/x86: dell-pc: Use devm_platform_profile_register()
  platform/x86: ideapad-laptop: Use devm_platform_profile_register()
  platform/x86: hp-wmi: Use devm_platform_profile_register()
  platform/x86: inspur_platform_profile: Use
    devm_platform_profile_register()
  platform/x86: thinkpad_acpi: Use devm_platform_profile_register()
  ACPI: platform_profile: Remove platform_profile_handler from exported
    symbols
  ACPI: platform_profile: Move platform_profile_handler
  ACPI: platform_profile: Clean platform_profile_handler
  ACPI: platform_profile: Add documentation
  ACPI: platform_profile: Add a prefix to log messages

 .../ABI/testing/sysfs-class-platform-profile  |  44 +++++
 drivers/acpi/platform_profile.c               | 172 +++++++++++++-----
 .../surface/surface_platform_profile.c        |  48 ++---
 drivers/platform/x86/acer-wmi.c               |  58 +++---
 drivers/platform/x86/amd/pmf/core.c           |   1 -
 drivers/platform/x86/amd/pmf/pmf.h            |   3 +-
 drivers/platform/x86/amd/pmf/sps.c            |  51 +++---
 drivers/platform/x86/asus-wmi.c               |  55 +++---
 drivers/platform/x86/dell/alienware-wmi.c     |  34 ++--
 drivers/platform/x86/dell/dell-pc.c           |  60 +++---
 drivers/platform/x86/hp/hp-wmi.c              |  83 +++++----
 drivers/platform/x86/ideapad-laptop.c         |  45 +++--
 .../platform/x86/inspur_platform_profile.c    |  48 +++--
 drivers/platform/x86/thinkpad_acpi.c          |  37 ++--
 include/linux/platform_profile.h              |  37 ++--
 15 files changed, 467 insertions(+), 309 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-platform-profile


base-commit: 58126788aa7726c0e91de6b25e6e332fa06089ab

Comments

Mario Limonciello Jan. 15, 2025, 4:45 p.m. UTC | #1
On 1/15/2025 01:10, Kurt Borja wrote:
> Declare a pr_fmt prefix.
> 
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>

I had to do a bit of a double take because you removed the prefix in 
patch 15/19 of one of existing messages.  So this makes sense at this 
place in the series, thanks!

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

> ---
>   drivers/acpi/platform_profile.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> index 4895f37dd549..c9e46b6e27da 100644
> --- a/drivers/acpi/platform_profile.c
> +++ b/drivers/acpi/platform_profile.c
> @@ -2,6 +2,8 @@
>   
>   /* Platform profile sysfs interface */
>   
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>   #include <linux/acpi.h>
>   #include <linux/bits.h>
>   #include <linux/cleanup.h>
Kurt Borja Jan. 15, 2025, 8:01 p.m. UTC | #2
On Wed, Jan 15, 2025 at 10:45:48AM -0600, Mario Limonciello wrote:
> On 1/15/2025 01:10, Kurt Borja wrote:
> > Declare a pr_fmt prefix.
> > 
> > Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> 
> I had to do a bit of a double take because you removed the prefix in patch
> 15/19 of one of existing messages.  So this makes sense at this place in the
> series, thanks!

Yes, I dropped the sanity check error message in favor of WARN_ON_ONCE
because not passing that sanity check would just be a bug. Apart from
that, there was only one more log message that needed the prefix and it
didn't need to be modified.

> 
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

Thanks!

~ Kurt

> 
> > ---
> >   drivers/acpi/platform_profile.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> > index 4895f37dd549..c9e46b6e27da 100644
> > --- a/drivers/acpi/platform_profile.c
> > +++ b/drivers/acpi/platform_profile.c
> > @@ -2,6 +2,8 @@
> >   /* Platform profile sysfs interface */
> > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > +
> >   #include <linux/acpi.h>
> >   #include <linux/bits.h>
> >   #include <linux/cleanup.h>
>