[PATCH v3 00/19] Hide platform_profile_handler from consumers

Kurt Borja
2025-01-15T07:11:14Z

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
--
2.48.0