aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRicardo B. Marliere <[email protected]>2024-03-01 14:46:15 -0300
committerSebastian Reichel <[email protected]>2024-03-01 21:16:01 +0100
commit71c2cc5cbf686c2397f43cbcb51a31589bdcee7b (patch)
tree3df5a49a4ab04e4a51c12d2de342a23cc105db64 /include
parent9a451f1b028e116d037a93bf13eb8f8620994205 (diff)
power: supply: core: make power_supply_class constant
Since commit 43a7206b0963 ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the power_supply_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman <[email protected]> Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Ricardo B. Marliere <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/linux/power_supply.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index c0992a77feea..514f652de64d 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -895,7 +895,7 @@ extern int power_supply_powers(struct power_supply *psy, struct device *dev);
extern void *power_supply_get_drvdata(struct power_supply *psy);
/* For APM emulation, think legacy userspace. */
-extern struct class *power_supply_class;
+extern const struct class power_supply_class;
static inline bool power_supply_is_amp_property(enum power_supply_property psp)
{