ARM: make of_device_ids const
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 18 Feb 2015 20:19:56 +0000 (21:19 +0100)
committerArnd Bergmann <arnd@arndb.de>
Thu, 19 Feb 2015 08:44:25 +0000 (09:44 +0100)
of_device_ids (i.e. compatible strings and the respective data) are not
supposed to change at runtime. All functions working with of_device_ids
provided by <linux/of.h> work with const of_device_ids. So mark the
non-const structs in arch/arm as const, too.

While at it also add some __initconst annotations.

Acked-by: Jason Cooper <jason@lakedameon.net>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
15 files changed:
arch/arm/kernel/perf_event_cpu.c
arch/arm/mach-at91/at91rm9200_time.c
arch/arm/mach-at91/pm.c
arch/arm/mach-davinci/da8xx-dt.c
arch/arm/mach-exynos/suspend.c
arch/arm/mach-imx/mmdc.c
arch/arm/mach-keystone/pm_domain.c
arch/arm/mach-mmp/time.c
arch/arm/mach-mvebu/coherency.c
arch/arm/mach-mvebu/pmsu.c
arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/prm3xxx.c
arch/arm/mach-omap2/prm44xx.c
arch/arm/mach-prima2/platsmp.c
arch/arm/mach-ux500/pm_domains.c

index dd9acc9..61b53c4 100644 (file)
@@ -231,7 +231,7 @@ static void cpu_pmu_destroy(struct arm_pmu *cpu_pmu)
 /*
  * PMU platform driver and devicetree bindings.
  */
-static struct of_device_id cpu_pmu_of_device_ids[] = {
+static const struct of_device_id cpu_pmu_of_device_ids[] = {
        {.compatible = "arm,cortex-a17-pmu",    .data = armv7_a17_pmu_init},
        {.compatible = "arm,cortex-a15-pmu",    .data = armv7_a15_pmu_init},
        {.compatible = "arm,cortex-a12-pmu",    .data = armv7_a12_pmu_init},
index 51761f8..b00d095 100644 (file)
@@ -183,7 +183,7 @@ static struct clock_event_device clkevt = {
 void __iomem *at91_st_base;
 EXPORT_SYMBOL_GPL(at91_st_base);
 
-static struct of_device_id at91rm9200_st_timer_ids[] = {
+static const struct of_device_id at91rm9200_st_timer_ids[] = {
        { .compatible = "atmel,at91rm9200-st" },
        { /* sentinel */ }
 };
index af8d8af..5e34fb1 100644 (file)
@@ -226,7 +226,7 @@ void at91_pm_set_standby(void (*at91_standby)(void))
        }
 }
 
-static struct of_device_id ramc_ids[] = {
+static const struct of_device_id ramc_ids[] __initconst = {
        { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
        { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
        { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
@@ -234,7 +234,7 @@ static struct of_device_id ramc_ids[] = {
        { /*sentinel*/ }
 };
 
-static void at91_dt_ramc(void)
+static __init void at91_dt_ramc(void)
 {
        struct device_node *np;
        const struct of_device_id *of_id;
index f703d82..438f685 100644 (file)
@@ -20,7 +20,7 @@
 
 #define DA8XX_NUM_UARTS        3
 
-static struct of_device_id da8xx_irq_match[] __initdata = {
+static const struct of_device_id da8xx_irq_match[] __initconst = {
        { .compatible = "ti,cp-intc", .data = cp_intc_of_init, },
        { }
 };
index 666ec3e..52e2b1a 100644 (file)
@@ -587,7 +587,7 @@ static struct exynos_pm_data exynos5420_pm_data = {
        .cpu_suspend    = exynos5420_cpu_suspend,
 };
 
-static struct of_device_id exynos_pmu_of_device_ids[] = {
+static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = {
        {
                .compatible = "samsung,exynos3250-pmu",
                .data = &exynos3250_pm_data,
index a377f95..0411f06 100644 (file)
@@ -68,7 +68,7 @@ int imx_mmdc_get_ddr_type(void)
        return ddr_type;
 }
 
-static struct of_device_id imx_mmdc_dt_ids[] = {
+static const struct of_device_id imx_mmdc_dt_ids[] = {
        { .compatible = "fsl,imx6q-mmdc", },
        { /* sentinel */ }
 };
index ef6041e..41bebfd 100644 (file)
@@ -61,7 +61,7 @@ static struct pm_clk_notifier_block platform_domain_notifier = {
        .pm_domain = &keystone_pm_domain,
 };
 
-static struct of_device_id of_keystone_table[] = {
+static const struct of_device_id of_keystone_table[] = {
        {.compatible = "ti,keystone"},
        { /* end of list */ },
 };
index 2756351..10bfa03 100644 (file)
@@ -213,7 +213,7 @@ void __init timer_init(int irq)
 }
 
 #ifdef CONFIG_OF
-static struct of_device_id mmp_timer_dt_ids[] = {
+static const struct of_device_id mmp_timer_dt_ids[] = {
        { .compatible = "mrvl,mmp-timer", },
        {}
 };
index b5895f0..e46e9ea 100644 (file)
@@ -51,7 +51,7 @@ enum {
        COHERENCY_FABRIC_TYPE_ARMADA_380,
 };
 
-static struct of_device_id of_coherency_table[] = {
+static const struct of_device_id of_coherency_table[] = {
        {.compatible = "marvell,coherency-fabric",
         .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP },
        {.compatible = "marvell,armada-375-coherency-fabric",
index d8ab605..8b9f5e2 100644 (file)
@@ -104,7 +104,7 @@ static void __iomem *pmsu_mp_base;
 
 static void *mvebu_cpu_resume;
 
-static struct of_device_id of_pmsu_table[] = {
+static const struct of_device_id of_pmsu_table[] = {
        { .compatible = "marvell,armada-370-pmsu", },
        { .compatible = "marvell,armada-370-xp-pmsu", },
        { .compatible = "marvell,armada-380-pmsu", },
index 2418bdf..cee0fe1 100644 (file)
@@ -242,7 +242,7 @@ static int __init omap4_sar_ram_init(void)
 }
 omap_early_initcall(omap4_sar_ram_init);
 
-static struct of_device_id gic_match[] = {
+static const struct of_device_id gic_match[] = {
        { .compatible = "arm,cortex-a9-gic", },
        { .compatible = "arm,cortex-a15-gic", },
        { },
index c5e00c6..5713bbd 100644 (file)
@@ -674,7 +674,7 @@ int __init omap3xxx_prm_init(void)
        return prm_register(&omap3xxx_prm_ll_data);
 }
 
-static struct of_device_id omap3_prm_dt_match_table[] = {
+static const struct of_device_id omap3_prm_dt_match_table[] = {
        { .compatible = "ti,omap3-prm" },
        { }
 };
index 408c64e..a08a617 100644 (file)
@@ -712,7 +712,7 @@ int __init omap44xx_prm_init(void)
        return prm_register(&omap44xx_prm_ll_data);
 }
 
-static struct of_device_id omap_prm_dt_match_table[] = {
+static const struct of_device_id omap_prm_dt_match_table[] = {
        { .compatible = "ti,omap4-prm" },
        { .compatible = "ti,omap5-prm" },
        { .compatible = "ti,dra7-prm" },
index fc2b03c..e46c910 100644 (file)
@@ -40,7 +40,7 @@ static void sirfsoc_secondary_init(unsigned int cpu)
        spin_unlock(&boot_lock);
 }
 
-static struct of_device_id clk_ids[]  = {
+static const struct of_device_id clk_ids[]  = {
        { .compatible = "sirf,atlas7-clkc" },
        {},
 };
index 0d4b5b4..4d71c90 100644 (file)
@@ -49,7 +49,7 @@ static struct generic_pm_domain *ux500_pm_domains[NR_DOMAINS] = {
        [DOMAIN_VAPE] = &ux500_pm_domain_vape,
 };
 
-static struct of_device_id ux500_pm_domain_matches[] = {
+static const struct of_device_id ux500_pm_domain_matches[] __initconst = {
        { .compatible = "stericsson,ux500-pm-domains", },
        { },
 };