Skip to content

Commit faf3b80

Browse files
rbmarlierestorulf
authored andcommitted
mmc: core: make mmc_host_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 mmc_host_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/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 32e8ee2 commit faf3b80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/core/host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static int mmc_host_classdev_shutdown(struct device *dev)
8888
return 0;
8989
}
9090

91-
static struct class mmc_host_class = {
91+
static const struct class mmc_host_class = {
9292
.name = "mmc_host",
9393
.dev_release = mmc_host_classdev_release,
9494
.shutdown_pre = mmc_host_classdev_shutdown,

0 commit comments

Comments
 (0)