power: supply: core: make power_supply_class constant
authorRicardo B. Marliere <ricardo@marliere.net>
Fri, 1 Mar 2024 17:46:15 +0000 (14:46 -0300)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 1 Mar 2024 20:16:01 +0000 (21:16 +0100)
commit71c2cc5cbf686c2397f43cbcb51a31589bdcee7b
tree3df5a49a4ab04e4a51c12d2de342a23cc105db64
parent9a451f1b028e116d037a93bf13eb8f8620994205
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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240301-class_cleanup-power-v1-1-97e0b7bf9c94@marliere.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500_btemp.c
drivers/power/supply/ab8500_chargalg.c
drivers/power/supply/ab8500_charger.c
drivers/power/supply/ab8500_fg.c
drivers/power/supply/apm_power.c
drivers/power/supply/power_supply_core.c
include/linux/power_supply.h