backlight: Make backlight_class constant
authorRicardo B. Marliere <ricardo@marliere.net>
Tue, 5 Mar 2024 12:21:17 +0000 (09:21 -0300)
committerLee Jones <lee@kernel.org>
Fri, 10 May 2024 14:44:28 +0000 (15:44 +0100)
commitcda12ba5550650daa1bab3347aea509d4f7ee361
tree3415370707cf5387b53eeef23cfc15b71e301c6f
parente962f13b1e86272a5dcdaede2dfb649152e981e9
backlight: Make backlight_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 backlight_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: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20240305-class_cleanup-backlight-v1-1-c0e15cc25be1@marliere.net
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/video/backlight/backlight.c