ARM: make of_device_ids const

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>

authored by Uwe Kleine-König and committed by Arnd Bergmann 444d2d33 543c5040

Changed files
+16 -16
arch
arm
kernel
mach-at91
mach-davinci
mach-exynos
mach-imx
mach-keystone
mach-mmp
mach-mvebu
mach-omap2
mach-prima2
mach-ux500
+1 -1
arch/arm/kernel/perf_event_cpu.c
··· 231 /* 232 * PMU platform driver and devicetree bindings. 233 */ 234 - static struct of_device_id cpu_pmu_of_device_ids[] = { 235 {.compatible = "arm,cortex-a17-pmu", .data = armv7_a17_pmu_init}, 236 {.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init}, 237 {.compatible = "arm,cortex-a12-pmu", .data = armv7_a12_pmu_init},
··· 231 /* 232 * PMU platform driver and devicetree bindings. 233 */ 234 + static const struct of_device_id cpu_pmu_of_device_ids[] = { 235 {.compatible = "arm,cortex-a17-pmu", .data = armv7_a17_pmu_init}, 236 {.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init}, 237 {.compatible = "arm,cortex-a12-pmu", .data = armv7_a12_pmu_init},
+1 -1
arch/arm/mach-at91/at91rm9200_time.c
··· 183 void __iomem *at91_st_base; 184 EXPORT_SYMBOL_GPL(at91_st_base); 185 186 - static struct of_device_id at91rm9200_st_timer_ids[] = { 187 { .compatible = "atmel,at91rm9200-st" }, 188 { /* sentinel */ } 189 };
··· 183 void __iomem *at91_st_base; 184 EXPORT_SYMBOL_GPL(at91_st_base); 185 186 + static const struct of_device_id at91rm9200_st_timer_ids[] = { 187 { .compatible = "atmel,at91rm9200-st" }, 188 { /* sentinel */ } 189 };
+2 -2
arch/arm/mach-at91/pm.c
··· 226 } 227 } 228 229 - static struct of_device_id ramc_ids[] = { 230 { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby }, 231 { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby }, 232 { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby }, ··· 234 { /*sentinel*/ } 235 }; 236 237 - static void at91_dt_ramc(void) 238 { 239 struct device_node *np; 240 const struct of_device_id *of_id;
··· 226 } 227 } 228 229 + static const struct of_device_id ramc_ids[] __initconst = { 230 { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby }, 231 { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby }, 232 { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby }, ··· 234 { /*sentinel*/ } 235 }; 236 237 + static __init void at91_dt_ramc(void) 238 { 239 struct device_node *np; 240 const struct of_device_id *of_id;
+1 -1
arch/arm/mach-davinci/da8xx-dt.c
··· 20 21 #define DA8XX_NUM_UARTS 3 22 23 - static struct of_device_id da8xx_irq_match[] __initdata = { 24 { .compatible = "ti,cp-intc", .data = cp_intc_of_init, }, 25 { } 26 };
··· 20 21 #define DA8XX_NUM_UARTS 3 22 23 + static const struct of_device_id da8xx_irq_match[] __initconst = { 24 { .compatible = "ti,cp-intc", .data = cp_intc_of_init, }, 25 { } 26 };
+1 -1
arch/arm/mach-exynos/suspend.c
··· 587 .cpu_suspend = exynos5420_cpu_suspend, 588 }; 589 590 - static struct of_device_id exynos_pmu_of_device_ids[] = { 591 { 592 .compatible = "samsung,exynos3250-pmu", 593 .data = &exynos3250_pm_data,
··· 587 .cpu_suspend = exynos5420_cpu_suspend, 588 }; 589 590 + static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = { 591 { 592 .compatible = "samsung,exynos3250-pmu", 593 .data = &exynos3250_pm_data,
+1 -1
arch/arm/mach-imx/mmdc.c
··· 68 return ddr_type; 69 } 70 71 - static struct of_device_id imx_mmdc_dt_ids[] = { 72 { .compatible = "fsl,imx6q-mmdc", }, 73 { /* sentinel */ } 74 };
··· 68 return ddr_type; 69 } 70 71 + static const struct of_device_id imx_mmdc_dt_ids[] = { 72 { .compatible = "fsl,imx6q-mmdc", }, 73 { /* sentinel */ } 74 };
+1 -1
arch/arm/mach-keystone/pm_domain.c
··· 61 .pm_domain = &keystone_pm_domain, 62 }; 63 64 - static struct of_device_id of_keystone_table[] = { 65 {.compatible = "ti,keystone"}, 66 { /* end of list */ }, 67 };
··· 61 .pm_domain = &keystone_pm_domain, 62 }; 63 64 + static const struct of_device_id of_keystone_table[] = { 65 {.compatible = "ti,keystone"}, 66 { /* end of list */ }, 67 };
+1 -1
arch/arm/mach-mmp/time.c
··· 213 } 214 215 #ifdef CONFIG_OF 216 - static struct of_device_id mmp_timer_dt_ids[] = { 217 { .compatible = "mrvl,mmp-timer", }, 218 {} 219 };
··· 213 } 214 215 #ifdef CONFIG_OF 216 + static const struct of_device_id mmp_timer_dt_ids[] = { 217 { .compatible = "mrvl,mmp-timer", }, 218 {} 219 };
+1 -1
arch/arm/mach-mvebu/coherency.c
··· 51 COHERENCY_FABRIC_TYPE_ARMADA_380, 52 }; 53 54 - static struct of_device_id of_coherency_table[] = { 55 {.compatible = "marvell,coherency-fabric", 56 .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP }, 57 {.compatible = "marvell,armada-375-coherency-fabric",
··· 51 COHERENCY_FABRIC_TYPE_ARMADA_380, 52 }; 53 54 + static const struct of_device_id of_coherency_table[] = { 55 {.compatible = "marvell,coherency-fabric", 56 .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP }, 57 {.compatible = "marvell,armada-375-coherency-fabric",
+1 -1
arch/arm/mach-mvebu/pmsu.c
··· 104 105 static void *mvebu_cpu_resume; 106 107 - static struct of_device_id of_pmsu_table[] = { 108 { .compatible = "marvell,armada-370-pmsu", }, 109 { .compatible = "marvell,armada-370-xp-pmsu", }, 110 { .compatible = "marvell,armada-380-pmsu", },
··· 104 105 static void *mvebu_cpu_resume; 106 107 + static const struct of_device_id of_pmsu_table[] = { 108 { .compatible = "marvell,armada-370-pmsu", }, 109 { .compatible = "marvell,armada-370-xp-pmsu", }, 110 { .compatible = "marvell,armada-380-pmsu", },
+1 -1
arch/arm/mach-omap2/omap4-common.c
··· 242 } 243 omap_early_initcall(omap4_sar_ram_init); 244 245 - static struct of_device_id gic_match[] = { 246 { .compatible = "arm,cortex-a9-gic", }, 247 { .compatible = "arm,cortex-a15-gic", }, 248 { },
··· 242 } 243 omap_early_initcall(omap4_sar_ram_init); 244 245 + static const struct of_device_id gic_match[] = { 246 { .compatible = "arm,cortex-a9-gic", }, 247 { .compatible = "arm,cortex-a15-gic", }, 248 { },
+1 -1
arch/arm/mach-omap2/prm3xxx.c
··· 674 return prm_register(&omap3xxx_prm_ll_data); 675 } 676 677 - static struct of_device_id omap3_prm_dt_match_table[] = { 678 { .compatible = "ti,omap3-prm" }, 679 { } 680 };
··· 674 return prm_register(&omap3xxx_prm_ll_data); 675 } 676 677 + static const struct of_device_id omap3_prm_dt_match_table[] = { 678 { .compatible = "ti,omap3-prm" }, 679 { } 680 };
+1 -1
arch/arm/mach-omap2/prm44xx.c
··· 712 return prm_register(&omap44xx_prm_ll_data); 713 } 714 715 - static struct of_device_id omap_prm_dt_match_table[] = { 716 { .compatible = "ti,omap4-prm" }, 717 { .compatible = "ti,omap5-prm" }, 718 { .compatible = "ti,dra7-prm" },
··· 712 return prm_register(&omap44xx_prm_ll_data); 713 } 714 715 + static const struct of_device_id omap_prm_dt_match_table[] = { 716 { .compatible = "ti,omap4-prm" }, 717 { .compatible = "ti,omap5-prm" }, 718 { .compatible = "ti,dra7-prm" },
+1 -1
arch/arm/mach-prima2/platsmp.c
··· 40 spin_unlock(&boot_lock); 41 } 42 43 - static struct of_device_id clk_ids[] = { 44 { .compatible = "sirf,atlas7-clkc" }, 45 {}, 46 };
··· 40 spin_unlock(&boot_lock); 41 } 42 43 + static const struct of_device_id clk_ids[] = { 44 { .compatible = "sirf,atlas7-clkc" }, 45 {}, 46 };
+1 -1
arch/arm/mach-ux500/pm_domains.c
··· 49 [DOMAIN_VAPE] = &ux500_pm_domain_vape, 50 }; 51 52 - static struct of_device_id ux500_pm_domain_matches[] = { 53 { .compatible = "stericsson,ux500-pm-domains", }, 54 { }, 55 };
··· 49 [DOMAIN_VAPE] = &ux500_pm_domain_vape, 50 }; 51 52 + static const struct of_device_id ux500_pm_domain_matches[] __initconst = { 53 { .compatible = "stericsson,ux500-pm-domains", }, 54 { }, 55 };