Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c915568d authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Chris Ball
Browse files

mmc: sdhci: Constify sdhci_ops structs where possible



Basically all drivers can have sdhci_ops struct const, but almost none do.
This patch constifies all sdhci_ops struct declarations where possible.

The patch was auto-generated with the following coccinelle semantic patch:

// <smpl>
@r1@
identifier ops;
identifier fld;
@@
ops.fld = ...;

@disable optional_qualifier@
identifier ops != r1.ops;
@@
static
+const
struct sdhci_ops ops = { ... };
// </smpl>

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent ad1df8c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ unsigned int bcm2835_sdhci_get_min_clock(struct sdhci_host *host)
	return MIN_FREQ;
}

static struct sdhci_ops bcm2835_sdhci_ops = {
static const struct sdhci_ops bcm2835_sdhci_ops = {
	.write_l = bcm2835_sdhci_writel,
	.write_w = bcm2835_sdhci_writew,
	.write_b = bcm2835_sdhci_writeb,
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ out:
	host->clock = clock;
}

static struct sdhci_ops sdhci_cns3xxx_ops = {
static const struct sdhci_ops sdhci_cns3xxx_ops = {
	.get_max_clock	= sdhci_cns3xxx_get_max_clk,
	.set_clock	= sdhci_cns3xxx_set_clock,
};
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static u32 sdhci_dove_readl(struct sdhci_host *host, int reg)
	return ret;
}

static struct sdhci_ops sdhci_dove_ops = {
static const struct sdhci_ops sdhci_dove_ops = {
	.read_w	= sdhci_dove_readw,
	.read_l	= sdhci_dove_readl,
};
+1 −1
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ static int esdhc_pltfm_bus_width(struct sdhci_host *host, int width)
	return 0;
}

static struct sdhci_ops sdhci_esdhc_ops = {
static const struct sdhci_ops sdhci_esdhc_ops = {
	.read_l = esdhc_readl_le,
	.read_w = esdhc_readw_le,
	.write_l = esdhc_writel_le,
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ static void esdhc_of_platform_init(struct sdhci_host *host)
		host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
}

static struct sdhci_ops sdhci_esdhc_ops = {
static const struct sdhci_ops sdhci_esdhc_ops = {
	.read_l = esdhc_readl,
	.read_w = esdhc_readw,
	.read_b = esdhc_readb,
Loading