]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mmc: sdhci: Constify sdhci_ops structs where possible
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 13 Mar 2013 18:26:05 +0000 (19:26 +0100)
committerChris Ball <cjb@laptop.org>
Fri, 22 Mar 2013 17:00:51 +0000 (13:00 -0400)
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: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 files changed:
drivers/mmc/host/sdhci-bcm2835.c
drivers/mmc/host/sdhci-cns3xxx.c
drivers/mmc/host/sdhci-dove.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-of-esdhc.c
drivers/mmc/host/sdhci-of-hlwd.c
drivers/mmc/host/sdhci-pci.c
drivers/mmc/host/sdhci-pltfm.c
drivers/mmc/host/sdhci-pxav2.c
drivers/mmc/host/sdhci-pxav3.c
drivers/mmc/host/sdhci-spear.c
drivers/mmc/host/sdhci-tegra.c

index 29e9e4008885964c508d0e200579337e2ea749c6..d49bc958c8ba07f6574c7a477de62d6581fd526e 100644 (file)
@@ -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,
index 15a936ae08b8a09c5653f2e2ddfecd5f29fba92a..4fa26ded589362972a79b3fb1728f794f0ae952b 100644 (file)
@@ -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,
 };
index b514f68d6f1b608ff6edce0edd48b8aa6cb68880..15e7803040f1ef48374afd974ff06210e8b47209 100644 (file)
@@ -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,
 };
index 68c301d12db4bf845b1f7e06021724764115466e..67d6dde2ff1961015304b3d3fac3fcd7040bcfd9 100644 (file)
@@ -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,
index b98b91969d8bcfbb960922c61aad439db3c91cf1..5e68adc2461e3d43e03a0634c3a2b0c1b2fd482a 100644 (file)
@@ -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,
index 7ea5c02268df93e91924ac39680d3404770e2dc5..200a6a9fa805d35d8731fcdd5740c6557acaa781 100644 (file)
@@ -51,7 +51,7 @@ static void sdhci_hlwd_writeb(struct sdhci_host *host, u8 val, int reg)
        udelay(SDHCI_HLWD_WRITE_DELAY);
 }
 
-static struct sdhci_ops sdhci_hlwd_ops = {
+static const struct sdhci_ops sdhci_hlwd_ops = {
        .read_l = sdhci_be32bs_readl,
        .read_w = sdhci_be32bs_readw,
        .read_b = sdhci_be32bs_readb,
index 3dee22d098e904c51566671346d4e9a5cae4fad5..c1f037266bdf0ea62c931c8c975c7968d7451247 100644 (file)
@@ -975,7 +975,7 @@ static void sdhci_pci_hw_reset(struct sdhci_host *host)
        usleep_range(300, 1000);
 }
 
-static struct sdhci_ops sdhci_pci_ops = {
+static const struct sdhci_ops sdhci_pci_ops = {
        .enable_dma     = sdhci_pci_enable_dma,
        .platform_bus_width     = sdhci_pci_bus_width,
        .hw_reset               = sdhci_pci_hw_reset,
index 3893fd6ae56ecc799816c3c298fd7d5c0d4fc908..cd0f1f68e261a8e244767f5e0dd9dc8ad39279b8 100644 (file)
@@ -44,7 +44,7 @@ unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host)
 }
 EXPORT_SYMBOL_GPL(sdhci_pltfm_clk_get_max_clock);
 
-static struct sdhci_ops sdhci_pltfm_ops = {
+static const struct sdhci_ops sdhci_pltfm_ops = {
 };
 
 #ifdef CONFIG_OF
index eeb7d439db1dcb4a2f1e20460ea841545874a30b..6a3f702a38a614ed2833dadafa2c719889386cb7 100644 (file)
@@ -111,7 +111,7 @@ static int pxav2_mmc_set_width(struct sdhci_host *host, int width)
        return 0;
 }
 
-static struct sdhci_ops pxav2_sdhci_ops = {
+static const struct sdhci_ops pxav2_sdhci_ops = {
        .get_max_clock = sdhci_pltfm_clk_get_max_clock,
        .platform_reset_exit = pxav2_set_private_registers,
        .platform_bus_width = pxav2_mmc_set_width,
index a0cdbc570a8384be89060384641d863c61b349fc..5663a6e754e542e23593077a7e0a0f3138ce837a 100644 (file)
@@ -167,7 +167,7 @@ static int pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
        return 0;
 }
 
-static struct sdhci_ops pxav3_sdhci_ops = {
+static const struct sdhci_ops pxav3_sdhci_ops = {
        .platform_reset_exit = pxav3_set_private_registers,
        .set_uhs_signaling = pxav3_set_uhs_signaling,
        .platform_send_init_74_clocks = pxav3_gen_init_74_clocks,
index c6ece0bd03b3317b9866009895e20efe10482b9d..8d28334ff913e6806bb8562e611ab4d8e5037402 100644 (file)
@@ -36,7 +36,7 @@ struct spear_sdhci {
 };
 
 /* sdhci ops */
-static struct sdhci_ops sdhci_pltfm_ops = {
+static const struct sdhci_ops sdhci_pltfm_ops = {
        /* Nothing to do for now. */
 };
 
index f8ac50c2883ec2affee54086c28ae1cf6dca8b7a..45048d1a4a2fcf37c360561783d3f473009e1ee7 100644 (file)
@@ -147,7 +147,7 @@ static int tegra_sdhci_buswidth(struct sdhci_host *host, int bus_width)
        return 0;
 }
 
-static struct sdhci_ops tegra_sdhci_ops = {
+static const struct sdhci_ops tegra_sdhci_ops = {
        .get_ro     = tegra_sdhci_get_ro,
        .read_l     = tegra_sdhci_readl,
        .read_w     = tegra_sdhci_readw,