Skip to content

Commit faf3b80

Browse files
rbmarliereUlf Hansson
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 <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-mmc-v1-1-4a66e7122ff3@marliere.net Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 32e8ee2 commit faf3b80

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)