diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-08-07 18:34:53 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-09-19 17:33:44 -0400 |
commit | cde214a890f81797a5eee94fffc89c1de21ed991 (patch) | |
tree | 14d1e7ad7854cf4dc214dd39745294101d1d9d14 /arch/arm/mach-shmobile/setup-r8a7790.c | |
parent | 0efd7faa6c611dab4ab8105473d2ffde7918cb69 (diff) |
ARM: shmobile: r8a7790: Constify platform data and resources
Platform data and resources for core devices are kmemdup()ed when the
corresponding devices are registered and can thus be declared as const.
Do so.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7790.c')
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7790.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c index a42d1f6f1f81..e0d29a265c2d 100644 --- a/arch/arm/mach-shmobile/setup-r8a7790.c +++ b/arch/arm/mach-shmobile/setup-r8a7790.c | |||
@@ -31,17 +31,18 @@ | |||
31 | #include <mach/r8a7790.h> | 31 | #include <mach/r8a7790.h> |
32 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
33 | 33 | ||
34 | static struct resource pfc_resources[] __initdata = { | 34 | static const struct resource pfc_resources[] __initconst = { |
35 | DEFINE_RES_MEM(0xe6060000, 0x250), | 35 | DEFINE_RES_MEM(0xe6060000, 0x250), |
36 | }; | 36 | }; |
37 | 37 | ||
38 | #define R8A7790_GPIO(idx) \ | 38 | #define R8A7790_GPIO(idx) \ |
39 | static struct resource r8a7790_gpio##idx##_resources[] __initdata = { \ | 39 | static const struct resource r8a7790_gpio##idx##_resources[] __initconst = { \ |
40 | DEFINE_RES_MEM(0xe6050000 + 0x1000 * (idx), 0x50), \ | 40 | DEFINE_RES_MEM(0xe6050000 + 0x1000 * (idx), 0x50), \ |
41 | DEFINE_RES_IRQ(gic_spi(4 + (idx))), \ | 41 | DEFINE_RES_IRQ(gic_spi(4 + (idx))), \ |
42 | }; \ | 42 | }; \ |
43 | \ | 43 | \ |
44 | static struct gpio_rcar_config r8a7790_gpio##idx##_platform_data __initdata = { \ | 44 | static const struct gpio_rcar_config \ |
45 | r8a7790_gpio##idx##_platform_data __initconst = { \ | ||
45 | .gpio_base = 32 * (idx), \ | 46 | .gpio_base = 32 * (idx), \ |
46 | .irq_base = 0, \ | 47 | .irq_base = 0, \ |
47 | .number_of_pins = 32, \ | 48 | .number_of_pins = 32, \ |
@@ -112,7 +113,7 @@ void __init r8a7790_pinmux_init(void) | |||
112 | enum { SCIFA0, SCIFA1, SCIFB0, SCIFB1, SCIFB2, SCIFA2, SCIF0, SCIF1, | 113 | enum { SCIFA0, SCIFA1, SCIFB0, SCIFB1, SCIFB2, SCIFA2, SCIF0, SCIF1, |
113 | HSCIF0, HSCIF1 }; | 114 | HSCIF0, HSCIF1 }; |
114 | 115 | ||
115 | static struct plat_sci_port scif[] __initdata = { | 116 | static const struct plat_sci_port scif[] __initconst = { |
116 | SCIFA_DATA(SCIFA0, 0xe6c40000, gic_spi(144)), /* SCIFA0 */ | 117 | SCIFA_DATA(SCIFA0, 0xe6c40000, gic_spi(144)), /* SCIFA0 */ |
117 | SCIFA_DATA(SCIFA1, 0xe6c50000, gic_spi(145)), /* SCIFA1 */ | 118 | SCIFA_DATA(SCIFA1, 0xe6c50000, gic_spi(145)), /* SCIFA1 */ |
118 | SCIFB_DATA(SCIFB0, 0xe6c20000, gic_spi(148)), /* SCIFB0 */ | 119 | SCIFB_DATA(SCIFB0, 0xe6c20000, gic_spi(148)), /* SCIFB0 */ |
@@ -131,11 +132,11 @@ static inline void r8a7790_register_scif(int idx) | |||
131 | sizeof(struct plat_sci_port)); | 132 | sizeof(struct plat_sci_port)); |
132 | } | 133 | } |
133 | 134 | ||
134 | static struct renesas_irqc_config irqc0_data __initdata = { | 135 | static const struct renesas_irqc_config irqc0_data __initconst = { |
135 | .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ | 136 | .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ |
136 | }; | 137 | }; |
137 | 138 | ||
138 | static struct resource irqc0_resources[] __initdata = { | 139 | static const struct resource irqc0_resources[] __initconst = { |
139 | DEFINE_RES_MEM(0xe61c0000, 0x200), /* IRQC Event Detector Block_0 */ | 140 | DEFINE_RES_MEM(0xe61c0000, 0x200), /* IRQC Event Detector Block_0 */ |
140 | DEFINE_RES_IRQ(gic_spi(0)), /* IRQ0 */ | 141 | DEFINE_RES_IRQ(gic_spi(0)), /* IRQ0 */ |
141 | DEFINE_RES_IRQ(gic_spi(1)), /* IRQ1 */ | 142 | DEFINE_RES_IRQ(gic_spi(1)), /* IRQ1 */ |
@@ -150,7 +151,7 @@ static struct resource irqc0_resources[] __initdata = { | |||
150 | &irqc##idx##_data, \ | 151 | &irqc##idx##_data, \ |
151 | sizeof(struct renesas_irqc_config)) | 152 | sizeof(struct renesas_irqc_config)) |
152 | 153 | ||
153 | static struct resource thermal_resources[] __initdata = { | 154 | static const struct resource thermal_resources[] __initconst = { |
154 | DEFINE_RES_MEM(0xe61f0000, 0x14), | 155 | DEFINE_RES_MEM(0xe61f0000, 0x14), |
155 | DEFINE_RES_MEM(0xe61f0100, 0x38), | 156 | DEFINE_RES_MEM(0xe61f0100, 0x38), |
156 | DEFINE_RES_IRQ(gic_spi(69)), | 157 | DEFINE_RES_IRQ(gic_spi(69)), |
@@ -161,13 +162,13 @@ static struct resource thermal_resources[] __initdata = { | |||
161 | thermal_resources, \ | 162 | thermal_resources, \ |
162 | ARRAY_SIZE(thermal_resources)) | 163 | ARRAY_SIZE(thermal_resources)) |
163 | 164 | ||
164 | static struct sh_timer_config cmt00_platform_data __initdata = { | 165 | static const struct sh_timer_config cmt00_platform_data __initconst = { |
165 | .name = "CMT00", | 166 | .name = "CMT00", |
166 | .timer_bit = 0, | 167 | .timer_bit = 0, |
167 | .clockevent_rating = 80, | 168 | .clockevent_rating = 80, |
168 | }; | 169 | }; |
169 | 170 | ||
170 | static struct resource cmt00_resources[] __initdata = { | 171 | static const struct resource cmt00_resources[] __initconst = { |
171 | DEFINE_RES_MEM(0xffca0510, 0x0c), | 172 | DEFINE_RES_MEM(0xffca0510, 0x0c), |
172 | DEFINE_RES_MEM(0xffca0500, 0x04), | 173 | DEFINE_RES_MEM(0xffca0500, 0x04), |
173 | DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */ | 174 | DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */ |
@@ -276,7 +277,7 @@ void __init r8a7790_init_early(void) | |||
276 | 277 | ||
277 | #ifdef CONFIG_USE_OF | 278 | #ifdef CONFIG_USE_OF |
278 | 279 | ||
279 | static const char *r8a7790_boards_compat_dt[] __initdata = { | 280 | static const char * const r8a7790_boards_compat_dt[] __initconst = { |
280 | "renesas,r8a7790", | 281 | "renesas,r8a7790", |
281 | NULL, | 282 | NULL, |
282 | }; | 283 | }; |