Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

remoteproc: Make rproc_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 rproc_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>
Link: https://lore.kernel.org/r/20240305-class_cleanup-remoteproc2-v1-1-1b139e9828c9@marliere.net
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>

authored by

Ricardo B. Marliere and committed by
Mathieu Poirier
1961511c 4cece764

+2 -2
+1 -1
drivers/remoteproc/remoteproc_internal.h
··· 72 72 void rproc_exit_debugfs(void); 73 73 74 74 /* from remoteproc_sysfs.c */ 75 - extern struct class rproc_class; 75 + extern const struct class rproc_class; 76 76 int rproc_init_sysfs(void); 77 77 void rproc_exit_sysfs(void); 78 78
+1 -1
drivers/remoteproc/remoteproc_sysfs.c
··· 254 254 NULL 255 255 }; 256 256 257 - struct class rproc_class = { 257 + const struct class rproc_class = { 258 258 .name = "remoteproc", 259 259 .dev_groups = rproc_devgroups, 260 260 };