Skip to content

Commit ffedbd2

Browse files
JuliaLawallstorulf
authored andcommitted
mmc: pwrseq: constify mmc_pwrseq_ops structures
The mmc_pwrseq_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent b5a84ec commit ffedbd2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/mmc/core/pwrseq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct mmc_pwrseq_ops {
1616
};
1717

1818
struct mmc_pwrseq {
19-
struct mmc_pwrseq_ops *ops;
19+
const struct mmc_pwrseq_ops *ops;
2020
};
2121

2222
#ifdef CONFIG_OF

drivers/mmc/core/pwrseq_emmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void mmc_pwrseq_emmc_free(struct mmc_host *host)
5151
kfree(pwrseq);
5252
}
5353

54-
static struct mmc_pwrseq_ops mmc_pwrseq_emmc_ops = {
54+
static const struct mmc_pwrseq_ops mmc_pwrseq_emmc_ops = {
5555
.post_power_on = mmc_pwrseq_emmc_reset,
5656
.free = mmc_pwrseq_emmc_free,
5757
};

drivers/mmc/core/pwrseq_simple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void mmc_pwrseq_simple_free(struct mmc_host *host)
8787
kfree(pwrseq);
8888
}
8989

90-
static struct mmc_pwrseq_ops mmc_pwrseq_simple_ops = {
90+
static const struct mmc_pwrseq_ops mmc_pwrseq_simple_ops = {
9191
.pre_power_on = mmc_pwrseq_simple_pre_power_on,
9292
.post_power_on = mmc_pwrseq_simple_post_power_on,
9393
.power_off = mmc_pwrseq_simple_power_off,

0 commit comments

Comments
 (0)