aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-10-06 09:55:53 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-12-06 11:52:23 -0500
commit7a5b4e16c880f8350d255dc188f81622905618c1 (patch)
tree78ab8222057c0578a641db587081e89bbcbdb1ef /arch
parent6ec22f9b037fc0c2e00ddb7023fad279c365324d (diff)
ARM: sa11x0: convert set_xxx_data() to register_xxx()
Only register devices if we have platform data for those which require platform data. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-sa1100/assabet.c8
-rw-r--r--arch/arm/mach-sa1100/badge4.c2
-rw-r--r--arch/arm/mach-sa1100/cerf.c4
-rw-r--r--arch/arm/mach-sa1100/collie.c6
-rw-r--r--arch/arm/mach-sa1100/generic.c31
-rw-r--r--arch/arm/mach-sa1100/generic.h11
-rw-r--r--arch/arm/mach-sa1100/h3600.c4
-rw-r--r--arch/arm/mach-sa1100/hackkit.c2
-rw-r--r--arch/arm/mach-sa1100/jornada720.c2
-rw-r--r--arch/arm/mach-sa1100/lart.c2
-rw-r--r--arch/arm/mach-sa1100/pleb.c2
-rw-r--r--arch/arm/mach-sa1100/shannon.c4
-rw-r--r--arch/arm/mach-sa1100/simpad.c4
13 files changed, 42 insertions, 40 deletions
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 55e64477a876..169e5b87dbff 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -249,10 +249,10 @@ static void __init assabet_init(void)
249#endif 249#endif
250 } 250 }
251 251
252 sa11x0_set_flash_data(&assabet_flash_data, assabet_flash_resources, 252 sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources,
253 ARRAY_SIZE(assabet_flash_resources)); 253 ARRAY_SIZE(assabet_flash_resources));
254 sa11x0_set_irda_data(&assabet_irda_data); 254 sa11x0_register_irda(&assabet_irda_data);
255 sa11x0_set_mcp_data(&assabet_mcp_data); 255 sa11x0_register_mcp(&assabet_mcp_data);
256} 256}
257 257
258/* 258/*
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index ab5883b39ddf..051ec0f0023c 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -212,7 +212,7 @@ static int __init badge4_init(void)
212 /* maybe turn on 5v0 from the start */ 212 /* maybe turn on 5v0 from the start */
213 badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on); 213 badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on);
214 214
215 sa11x0_set_flash_data(&badge4_flash_data, &badge4_flash_resource, 1); 215 sa11x0_register_mtd(&badge4_flash_data, &badge4_flash_resource, 1);
216 216
217 return 0; 217 return 0;
218} 218}
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index fd3ad9cfc912..bc950ef418af 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -129,8 +129,8 @@ static struct mcp_plat_data cerf_mcp_data = {
129static void __init cerf_init(void) 129static void __init cerf_init(void)
130{ 130{
131 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); 131 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
132 sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1); 132 sa11x0_register_mtd(&cerf_flash_data, &cerf_flash_resource, 1);
133 sa11x0_set_mcp_data(&cerf_mcp_data); 133 sa11x0_register_mcp(&cerf_mcp_data);
134} 134}
135 135
136MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") 136MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index bbf2ebcc3066..be7e5a3c47d0 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -272,9 +272,9 @@ static void __init collie_init(void)
272 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); 272 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
273 } 273 }
274 274
275 sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources, 275 sa11x0_register_mtd(&collie_flash_data, collie_flash_resources,
276 ARRAY_SIZE(collie_flash_resources)); 276 ARRAY_SIZE(collie_flash_resources));
277 sa11x0_set_mcp_data(&collie_mcp_data); 277 sa11x0_register_mcp(&collie_mcp_data);
278 278
279 sharpsl_save_param(); 279 sharpsl_save_param();
280} 280}
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 23cfdd593954..9faea1511c1f 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -162,6 +162,17 @@ static void sa1100_power_off(void)
162 PMCR = PMCR_SF; 162 PMCR = PMCR_SF;
163} 163}
164 164
165static void sa11x0_register_device(struct platform_device *dev, void *data)
166{
167 int err;
168 dev->dev.platform_data = data;
169 err = platform_device_register(dev);
170 if (err)
171 printk(KERN_ERR "Unable to register device %s: %d\n",
172 dev->name, err);
173}
174
175
165static struct resource sa11x0udc_resources[] = { 176static struct resource sa11x0udc_resources[] = {
166 [0] = { 177 [0] = {
167 .start = 0x80000000, 178 .start = 0x80000000,
@@ -234,9 +245,9 @@ static struct platform_device sa11x0mcp_device = {
234 .resource = sa11x0mcp_resources, 245 .resource = sa11x0mcp_resources,
235}; 246};
236 247
237void sa11x0_set_mcp_data(struct mcp_plat_data *data) 248void sa11x0_register_mcp(struct mcp_plat_data *data)
238{ 249{
239 sa11x0mcp_device.dev.platform_data = data; 250 sa11x0_register_device(&sa11x0mcp_device, data);
240} 251}
241 252
242static struct resource sa11x0ssp_resources[] = { 253static struct resource sa11x0ssp_resources[] = {
@@ -293,13 +304,13 @@ static struct platform_device sa11x0mtd_device = {
293 .id = -1, 304 .id = -1,
294}; 305};
295 306
296void sa11x0_set_flash_data(struct flash_platform_data *flash, 307void sa11x0_register_mtd(struct flash_platform_data *flash,
297 struct resource *res, int nr) 308 struct resource *res, int nr)
298{ 309{
299 flash->name = "sa1100"; 310 flash->name = "sa1100";
300 sa11x0mtd_device.dev.platform_data = flash;
301 sa11x0mtd_device.resource = res; 311 sa11x0mtd_device.resource = res;
302 sa11x0mtd_device.num_resources = nr; 312 sa11x0mtd_device.num_resources = nr;
313 sa11x0_register_device(&sa11x0mtd_device, flash);
303} 314}
304 315
305static struct resource sa11x0ir_resources[] = { 316static struct resource sa11x0ir_resources[] = {
@@ -329,9 +340,9 @@ static struct platform_device sa11x0ir_device = {
329 .resource = sa11x0ir_resources, 340 .resource = sa11x0ir_resources,
330}; 341};
331 342
332void sa11x0_set_irda_data(struct irda_platform_data *irda) 343void sa11x0_register_irda(struct irda_platform_data *irda)
333{ 344{
334 sa11x0ir_device.dev.platform_data = irda; 345 sa11x0_register_device(&sa11x0ir_device, irda);
335} 346}
336 347
337static struct platform_device sa11x0rtc_device = { 348static struct platform_device sa11x0rtc_device = {
@@ -343,21 +354,15 @@ static struct platform_device *sa11x0_devices[] __initdata = {
343 &sa11x0udc_device, 354 &sa11x0udc_device,
344 &sa11x0uart1_device, 355 &sa11x0uart1_device,
345 &sa11x0uart3_device, 356 &sa11x0uart3_device,
346 &sa11x0mcp_device,
347 &sa11x0ssp_device, 357 &sa11x0ssp_device,
348 &sa11x0pcmcia_device, 358 &sa11x0pcmcia_device,
349 &sa11x0fb_device, 359 &sa11x0fb_device,
350 &sa11x0mtd_device,
351 &sa11x0rtc_device, 360 &sa11x0rtc_device,
352}; 361};
353 362
354static int __init sa1100_init(void) 363static int __init sa1100_init(void)
355{ 364{
356 pm_power_off = sa1100_power_off; 365 pm_power_off = sa1100_power_off;
357
358 if (sa11x0ir_device.dev.platform_data)
359 platform_device_register(&sa11x0ir_device);
360
361 return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices)); 366 return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices));
362} 367}
363 368
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 793c2e6c991f..ec03f187c52b 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -32,14 +32,11 @@ extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx);
32struct flash_platform_data; 32struct flash_platform_data;
33struct resource; 33struct resource;
34 34
35extern void sa11x0_set_flash_data(struct flash_platform_data *flash, 35void sa11x0_register_mtd(struct flash_platform_data *flash,
36 struct resource *res, int nr); 36 struct resource *res, int nr);
37
38struct sa11x0_ssp_plat_ops;
39extern void sa11x0_set_ssp_data(struct sa11x0_ssp_plat_ops *ops);
40 37
41struct irda_platform_data; 38struct irda_platform_data;
42void sa11x0_set_irda_data(struct irda_platform_data *irda); 39void sa11x0_register_irda(struct irda_platform_data *irda);
43 40
44struct mcp_plat_data; 41struct mcp_plat_data;
45void sa11x0_set_mcp_data(struct mcp_plat_data *data); 42void sa11x0_register_mcp(struct mcp_plat_data *data);
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 0eb2f159578b..0b4b8704f9b3 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -102,8 +102,8 @@ static struct irda_platform_data h3600_irda_data = {
102 102
103static void h3xxx_mach_init(void) 103static void h3xxx_mach_init(void)
104{ 104{
105 sa11x0_set_flash_data(&h3xxx_flash_data, &h3xxx_flash_resource, 1); 105 sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1);
106 sa11x0_set_irda_data(&h3600_irda_data); 106 sa11x0_register_irda(&h3600_irda_data);
107} 107}
108 108
109/* 109/*
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index e7056c0b562c..51568dfc8e97 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -187,7 +187,7 @@ static struct resource hackkit_flash_resource = {
187 187
188static void __init hackkit_init(void) 188static void __init hackkit_init(void)
189{ 189{
190 sa11x0_set_flash_data(&hackkit_flash_data, &hackkit_flash_resource, 1); 190 sa11x0_register_mtd(&hackkit_flash_data, &hackkit_flash_resource, 1);
191} 191}
192 192
193/********************************************************************** 193/**********************************************************************
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index fd776bb666cd..13ebd2d99bfd 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -354,7 +354,7 @@ static struct resource jornada720_flash_resource = {
354 354
355static void __init jornada720_mach_init(void) 355static void __init jornada720_mach_init(void)
356{ 356{
357 sa11x0_set_flash_data(&jornada720_flash_data, &jornada720_flash_resource, 1); 357 sa11x0_register_mtd(&jornada720_flash_data, &jornada720_flash_resource, 1);
358} 358}
359 359
360MACHINE_START(JORNADA720, "HP Jornada 720") 360MACHINE_START(JORNADA720, "HP Jornada 720")
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 1f940df0e5af..68069d6dc07a 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -28,7 +28,7 @@ static struct mcp_plat_data lart_mcp_data = {
28 28
29static void __init lart_init(void) 29static void __init lart_init(void)
30{ 30{
31 sa11x0_set_mcp_data(&lart_mcp_data); 31 sa11x0_register_mcp(&lart_mcp_data);
32} 32}
33 33
34static struct map_desc lart_io_desc[] __initdata = { 34static struct map_desc lart_io_desc[] __initdata = {
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index e1458bc1868e..1ccd6018d3a3 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -109,7 +109,7 @@ static struct flash_platform_data pleb_flash_data = {
109 109
110static void __init pleb_init(void) 110static void __init pleb_init(void)
111{ 111{
112 sa11x0_set_flash_data(&pleb_flash_data, pleb_flash_resources, 112 sa11x0_register_mtd(&pleb_flash_data, pleb_flash_resources,
113 ARRAY_SIZE(pleb_flash_resources)); 113 ARRAY_SIZE(pleb_flash_resources));
114 114
115 115
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index ddd917d1083d..85e82bb73d7e 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -59,8 +59,8 @@ static struct mcp_plat_data shannon_mcp_data = {
59 59
60static void __init shannon_init(void) 60static void __init shannon_init(void)
61{ 61{
62 sa11x0_set_flash_data(&shannon_flash_data, &shannon_flash_resource, 1); 62 sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);
63 sa11x0_set_mcp_data(&shannon_mcp_data); 63 sa11x0_register_mcp(&shannon_mcp_data);
64} 64}
65 65
66static void __init shannon_map_io(void) 66static void __init shannon_map_io(void)
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 3c74534f7fee..49cfd64663ac 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -166,9 +166,9 @@ static void __init simpad_map_io(void)
166 PCFR = 0; 166 PCFR = 0;
167 PSDR = 0; 167 PSDR = 0;
168 168
169 sa11x0_set_flash_data(&simpad_flash_data, simpad_flash_resources, 169 sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
170 ARRAY_SIZE(simpad_flash_resources)); 170 ARRAY_SIZE(simpad_flash_resources));
171 sa11x0_set_mcp_data(&simpad_mcp_data); 171 sa11x0_register_mcp(&simpad_mcp_data);
172} 172}
173 173
174static void simpad_power_off(void) 174static void simpad_power_off(void)