diff options
author | Kurt Borja <kuurtb@gmail.com> | 2025-01-15 19:27:04 -0500 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-01-16 17:26:25 +0200 |
commit | 249c576f0f9d0556cb7473b8a437b30239afbd16 (patch) | |
tree | 32144fa48c6617078a540b46df5f899e2c7ef084 /drivers/platform/x86/asus-wmi.c | |
parent | d960f14800b581d79e1c3df4db524d9d4b3aac9a (diff) |
ACPI: platform_profile: Let drivers set drvdata to the class device
Add *drvdata to platform_profile_register() signature and assign it to
the class device.
While at it, pass specific driver state as drvdata to replace uses of
container_of() with dev_get_drvdata().
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://lore.kernel.org/r/20250116002721.75592-3-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/asus-wmi.c')
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 6c674de60ec0..f91099792cb9 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -3806,7 +3806,7 @@ static int asus_wmi_platform_profile_get(struct platform_profile_handler *pprof, struct asus_wmi *asus; int tp; - asus = container_of(pprof, struct asus_wmi, platform_profile_handler); + asus = dev_get_drvdata(&pprof->class_dev); tp = asus->throttle_thermal_policy_mode; switch (tp) { @@ -3832,7 +3832,7 @@ static int asus_wmi_platform_profile_set(struct platform_profile_handler *pprof, struct asus_wmi *asus; int tp; - asus = container_of(pprof, struct asus_wmi, platform_profile_handler); + asus = dev_get_drvdata(&pprof->class_dev); switch (profile) { case PLATFORM_PROFILE_PERFORMANCE: @@ -3887,7 +3887,7 @@ static int platform_profile_setup(struct asus_wmi *asus) set_bit(PLATFORM_PROFILE_PERFORMANCE, asus->platform_profile_handler.choices); - err = platform_profile_register(&asus->platform_profile_handler); + err = platform_profile_register(&asus->platform_profile_handler, asus); if (err == -EEXIST) { pr_warn("%s, a platform_profile handler is already registered\n", __func__); return 0; |