Skip to content

Commit 9d56653

Browse files
FlyGoatrafaeljw
authored andcommitted
ACPI: platform-profile: Drop const qualifier for cur_profile
Drop the const qualifier from the static global cur_profile pointer declaration. This is a preparation patch for passing the cur_profile pointer as parameter to the profile_get() and profile_set() callbacks so that drivers dynamically allocating their driver-data struct, with their platform_profile_handler struct embedded, can use this pointer to get to their driver-data. Note this also requires dropping the const from the pprof platform_profile_register() function argument. Dropping this const is not a problem, non of the queued up consumers of platform_profile_register() actually pass in a const pointer. Link: https://lore.kernel.org/linux-acpi/5e7a4d87-52ef-e487-9cc2-8e7094beaa08@redhat.com/ Link: https://lore.kernel.org/r/20210114073429.176462-2-jiaxun.yang@flygoat.com Suggested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> [ hdegoede@redhat.com: Also remove const from platform_profile_register() ] Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent a2ff95e commit 9d56653

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/acpi/platform_profile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <linux/platform_profile.h>
1010
#include <linux/sysfs.h>
1111

12-
static const struct platform_profile_handler *cur_profile;
12+
static struct platform_profile_handler *cur_profile;
1313
static DEFINE_MUTEX(profile_lock);
1414

1515
static const char * const profile_names[] = {
@@ -132,7 +132,7 @@ void platform_profile_notify(void)
132132
}
133133
EXPORT_SYMBOL_GPL(platform_profile_notify);
134134

135-
int platform_profile_register(const struct platform_profile_handler *pprof)
135+
int platform_profile_register(struct platform_profile_handler *pprof)
136136
{
137137
int err;
138138

include/linux/platform_profile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct platform_profile_handler {
3232
int (*profile_set)(enum platform_profile_option profile);
3333
};
3434

35-
int platform_profile_register(const struct platform_profile_handler *pprof);
35+
int platform_profile_register(struct platform_profile_handler *pprof);
3636
int platform_profile_remove(void);
3737
void platform_profile_notify(void);
3838

0 commit comments

Comments
 (0)