Skip to content

Commit 1961511

Browse files
rbmarlieremathieupoirier
authored andcommitted
remoteproc: Make rproc_class constant
Since commit 43a7206 ("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 <[email protected]> Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Ricardo B. Marliere <[email protected]> Link: https://lore.kernel.org/r/20240305-class_cleanup-remoteproc2-v1-1-1b139e9828c9@marliere.net Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 4cece76 commit 1961511

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/remoteproc/remoteproc_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void rproc_init_debugfs(void);
7272
void rproc_exit_debugfs(void);
7373

7474
/* from remoteproc_sysfs.c */
75-
extern struct class rproc_class;
75+
extern const struct class rproc_class;
7676
int rproc_init_sysfs(void);
7777
void rproc_exit_sysfs(void);
7878

drivers/remoteproc/remoteproc_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static const struct attribute_group *rproc_devgroups[] = {
254254
NULL
255255
};
256256

257-
struct class rproc_class = {
257+
const struct class rproc_class = {
258258
.name = "remoteproc",
259259
.dev_groups = rproc_devgroups,
260260
};

0 commit comments

Comments
 (0)