aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-09-08 11:04:41 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-09-08 11:04:41 -0400
commit6df29debb7fc04ac3f92038c57437f40bab4e72d (patch)
treefbf9c8697c39c587471cbf18736c3692b55d3605
parentcaf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff)
[SERIAL] Use an enum for serial8250 platform device IDs
Rather than hard-coding the platform device IDs, enumerate them. We don't particularly care about the actual ID we get, just as long as they're unique. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-clps7500/core.c2
-rw-r--r--arch/arm/mach-ebsa110/core.c2
-rw-r--r--arch/arm/mach-epxa10db/arch.c2
-rw-r--r--arch/arm/mach-footbridge/isa.c2
-rw-r--r--arch/arm/mach-h720x/cpu-h7202.c2
-rw-r--r--arch/arm/mach-ixp2000/core.c2
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c2
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c2
-rw-r--r--arch/arm/mach-omap1/serial.c2
-rw-r--r--arch/arm/mach-rpc/riscpc.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c2
-rw-r--r--arch/arm/mach-shark/core.c2
-rw-r--r--arch/ppc/syslib/mpc10x_common.c4
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c2
-rw-r--r--arch/ppc/syslib/mpc85xx_devices.c2
-rw-r--r--arch/ppc64/kernel/setup.c2
-rw-r--r--drivers/serial/8250.c2
-rw-r--r--drivers/serial/8250_accent.c2
-rw-r--r--drivers/serial/8250_boca.c2
-rw-r--r--drivers/serial/8250_fourport.c2
-rw-r--r--drivers/serial/8250_hub6.c2
-rw-r--r--drivers/serial/8250_mca.c2
-rw-r--r--include/linux/serial_8250.h15
26 files changed, 41 insertions, 26 deletions
diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c
index 112f1d68fb2b..e216ab8b9e8f 100644
--- a/arch/arm/mach-clps7500/core.c
+++ b/arch/arm/mach-clps7500/core.c
@@ -354,7 +354,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
354 354
355static struct platform_device serial_device = { 355static struct platform_device serial_device = {
356 .name = "serial8250", 356 .name = "serial8250",
357 .id = 0, 357 .id = PLAT8250_DEV_PLATFORM,
358 .dev = { 358 .dev = {
359 .platform_data = serial_platform_data, 359 .platform_data = serial_platform_data,
360 }, 360 },
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index 23c4da10101b..5aeadfd72143 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -219,7 +219,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
219 219
220static struct platform_device serial_device = { 220static struct platform_device serial_device = {
221 .name = "serial8250", 221 .name = "serial8250",
222 .id = 0, 222 .id = PLAT8250_DEV_PLATFORM,
223 .dev = { 223 .dev = {
224 .platform_data = serial_platform_data, 224 .platform_data = serial_platform_data,
225 }, 225 },
diff --git a/arch/arm/mach-epxa10db/arch.c b/arch/arm/mach-epxa10db/arch.c
index 7daa021676d0..44c56571d183 100644
--- a/arch/arm/mach-epxa10db/arch.c
+++ b/arch/arm/mach-epxa10db/arch.c
@@ -52,7 +52,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
52 52
53static struct platform_device serial_device = { 53static struct platform_device serial_device = {
54 .name = "serial8250", 54 .name = "serial8250",
55 .id = 0, 55 .id = PLAT8250_DEV_PLATFORM,
56 .dev = { 56 .dev = {
57 .platform_data = serial_platform_data, 57 .platform_data = serial_platform_data,
58 }, 58 },
diff --git a/arch/arm/mach-footbridge/isa.c b/arch/arm/mach-footbridge/isa.c
index aa3a1fef563e..28846c7edaaf 100644
--- a/arch/arm/mach-footbridge/isa.c
+++ b/arch/arm/mach-footbridge/isa.c
@@ -34,7 +34,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
34 34
35static struct platform_device serial_device = { 35static struct platform_device serial_device = {
36 .name = "serial8250", 36 .name = "serial8250",
37 .id = 0, 37 .id = PLAT8250_DEV_PLATFORM,
38 .dev = { 38 .dev = {
39 .platform_data = serial_platform_data, 39 .platform_data = serial_platform_data,
40 }, 40 },
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c
index 4b3199319e68..a4a7c0125d03 100644
--- a/arch/arm/mach-h720x/cpu-h7202.c
+++ b/arch/arm/mach-h720x/cpu-h7202.c
@@ -90,7 +90,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
90 90
91static struct platform_device serial_device = { 91static struct platform_device serial_device = {
92 .name = "serial8250", 92 .name = "serial8250",
93 .id = 0, 93 .id = PLAT8250_DEV_PLATFORM,
94 .dev = { 94 .dev = {
95 .platform_data = serial_platform_data, 95 .platform_data = serial_platform_data,
96 }, 96 },
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 098c817a7fb8..74bd2fd602d4 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -174,7 +174,7 @@ static struct resource ixp2000_uart_resource = {
174 174
175static struct platform_device ixp2000_serial_device = { 175static struct platform_device ixp2000_serial_device = {
176 .name = "serial8250", 176 .name = "serial8250",
177 .id = 0, 177 .id = PLAT8250_DEV_PLATFORM,
178 .dev = { 178 .dev = {
179 .platform_data = ixp2000_serial_port, 179 .platform_data = ixp2000_serial_port,
180 }, 180 },
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 8b2f25322452..050c92768913 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -66,7 +66,7 @@ static struct plat_serial8250_port coyote_uart_data[] = {
66 66
67static struct platform_device coyote_uart = { 67static struct platform_device coyote_uart = {
68 .name = "serial8250", 68 .name = "serial8250",
69 .id = 0, 69 .id = PLAT8250_DEV_PLATFORM,
70 .dev = { 70 .dev = {
71 .platform_data = coyote_uart_data, 71 .platform_data = coyote_uart_data,
72 }, 72 },
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 3fd92c5cbaa8..29a6d02fa851 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -93,7 +93,7 @@ static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
93 93
94static struct platform_device gtwx5715_uart_device = { 94static struct platform_device gtwx5715_uart_device = {
95 .name = "serial8250", 95 .name = "serial8250",
96 .id = 0, 96 .id = PLAT8250_DEV_PLATFORM,
97 .dev = { 97 .dev = {
98 .platform_data = gtwx5715_uart_platform_data, 98 .platform_data = gtwx5715_uart_platform_data,
99 }, 99 },
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 6c14ff3c23a0..ae1fa099d5fa 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -96,7 +96,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = {
96 96
97static struct platform_device ixdp425_uart = { 97static struct platform_device ixdp425_uart = {
98 .name = "serial8250", 98 .name = "serial8250",
99 .id = 0, 99 .id = PLAT8250_DEV_PLATFORM,
100 .dev.platform_data = ixdp425_uart_data, 100 .dev.platform_data = ixdp425_uart_data,
101 .num_resources = 2, 101 .num_resources = 2,
102 .resource = ixdp425_uart_resources 102 .resource = ixdp425_uart_resources
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index e42281988990..76176dd518ba 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -74,7 +74,7 @@ static struct plat_serial8250_port voiceblue_ports[] = {
74 74
75static struct platform_device serial_device = { 75static struct platform_device serial_device = {
76 .name = "serial8250", 76 .name = "serial8250",
77 .id = 1, 77 .id = PLAT8250_DEV_PLATFORM1,
78 .dev = { 78 .dev = {
79 .platform_data = voiceblue_ports, 79 .platform_data = voiceblue_ports,
80 }, 80 },
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 214e5d17c8b5..1446bf332e4c 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -94,7 +94,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
94 94
95static struct platform_device serial_device = { 95static struct platform_device serial_device = {
96 .name = "serial8250", 96 .name = "serial8250",
97 .id = 0, 97 .id = PLAT8250_DEV_PLATFORM,
98 .dev = { 98 .dev = {
99 .platform_data = serial_platform_data, 99 .platform_data = serial_platform_data,
100 }, 100 },
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index a10268618f74..e3587efec4bf 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -140,7 +140,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
140 140
141static struct platform_device serial_device = { 141static struct platform_device serial_device = {
142 .name = "serial8250", 142 .name = "serial8250",
143 .id = 0, 143 .id = PLAT8250_DEV_PLATFORM,
144 .dev = { 144 .dev = {
145 .platform_data = serial_platform_data, 145 .platform_data = serial_platform_data,
146 }, 146 },
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index e9182242da95..1a3367da6408 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -381,7 +381,7 @@ static struct plat_serial8250_port bast_sio_data[] = {
381 381
382static struct platform_device bast_sio = { 382static struct platform_device bast_sio = {
383 .name = "serial8250", 383 .name = "serial8250",
384 .id = 0, 384 .id = PLAT8250_DEV_PLATFORM,
385 .dev = { 385 .dev = {
386 .platform_data = &bast_sio_data, 386 .platform_data = &bast_sio_data,
387 }, 387 },
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 924e8464c212..8f9ab2893df4 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -221,7 +221,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
221 221
222static struct platform_device serial_device = { 222static struct platform_device serial_device = {
223 .name = "serial8250", 223 .name = "serial8250",
224 .id = 0, 224 .id = PLAT8250_DEV_PLATFORM,
225 .dev = { 225 .dev = {
226 .platform_data = serial_platform_data, 226 .platform_data = serial_platform_data,
227 }, 227 },
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index e737eae4521f..946c0d11c73b 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -41,7 +41,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
41 41
42static struct platform_device serial_device = { 42static struct platform_device serial_device = {
43 .name = "serial8250", 43 .name = "serial8250",
44 .id = 0, 44 .id = PLAT8250_DEV_PLATFORM,
45 .dev = { 45 .dev = {
46 .platform_data = serial_platform_data, 46 .platform_data = serial_platform_data,
47 }, 47 },
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
index 87065e2e4c5f..3e039706bdbc 100644
--- a/arch/ppc/syslib/mpc10x_common.c
+++ b/arch/ppc/syslib/mpc10x_common.c
@@ -140,12 +140,12 @@ struct platform_device ppc_sys_platform_devices[] = {
140 }, 140 },
141 [MPC10X_UART0] = { 141 [MPC10X_UART0] = {
142 .name = "serial8250", 142 .name = "serial8250",
143 .id = 0, 143 .id = PLAT8250_DEV_PLATFORM,
144 .dev.platform_data = serial_plat_uart0, 144 .dev.platform_data = serial_plat_uart0,
145 }, 145 },
146 [MPC10X_UART1] = { 146 [MPC10X_UART1] = {
147 .name = "serial8250", 147 .name = "serial8250",
148 .id = 1, 148 .id = PLAT8250_DEV_PLATFORM1,
149 .dev.platform_data = serial_plat_uart1, 149 .dev.platform_data = serial_plat_uart1,
150 }, 150 },
151 151
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index 5aaf0e58e1f9..95b3b8a7f0ba 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -165,7 +165,7 @@ struct platform_device ppc_sys_platform_devices[] = {
165 }, 165 },
166 [MPC83xx_DUART] = { 166 [MPC83xx_DUART] = {
167 .name = "serial8250", 167 .name = "serial8250",
168 .id = 0, 168 .id = PLAT8250_DEV_PLATFORM,
169 .dev.platform_data = serial_platform_data, 169 .dev.platform_data = serial_platform_data,
170 }, 170 },
171 [MPC83xx_SEC2] = { 171 [MPC83xx_SEC2] = {
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c
index 8af322dd476a..bbc5ac0de878 100644
--- a/arch/ppc/syslib/mpc85xx_devices.c
+++ b/arch/ppc/syslib/mpc85xx_devices.c
@@ -282,7 +282,7 @@ struct platform_device ppc_sys_platform_devices[] = {
282 }, 282 },
283 [MPC85xx_DUART] = { 283 [MPC85xx_DUART] = {
284 .name = "serial8250", 284 .name = "serial8250",
285 .id = 0, 285 .id = PLAT8250_DEV_PLATFORM,
286 .dev.platform_data = serial_platform_data, 286 .dev.platform_data = serial_platform_data,
287 }, 287 },
288 [MPC85xx_PERFMON] = { 288 [MPC85xx_PERFMON] = {
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
index d0bb68af0ea4..bfa8791c9807 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -1283,7 +1283,7 @@ void __init generic_find_legacy_serial_ports(u64 *physport,
1283 1283
1284static struct platform_device serial_device = { 1284static struct platform_device serial_device = {
1285 .name = "serial8250", 1285 .name = "serial8250",
1286 .id = 0, 1286 .id = PLAT8250_DEV_PLATFORM,
1287 .dev = { 1287 .dev = {
1288 .platform_data = serial_ports, 1288 .platform_data = serial_ports,
1289 }, 1289 },
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 30a0a3d10145..5b65e208893b 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2536,7 +2536,7 @@ static int __init serial8250_init(void)
2536 goto out; 2536 goto out;
2537 2537
2538 serial8250_isa_devs = platform_device_register_simple("serial8250", 2538 serial8250_isa_devs = platform_device_register_simple("serial8250",
2539 -1, NULL, 0); 2539 PLAT8250_DEV_LEGACY, NULL, 0);
2540 if (IS_ERR(serial8250_isa_devs)) { 2540 if (IS_ERR(serial8250_isa_devs)) {
2541 ret = PTR_ERR(serial8250_isa_devs); 2541 ret = PTR_ERR(serial8250_isa_devs);
2542 goto unreg; 2542 goto unreg;
diff --git a/drivers/serial/8250_accent.c b/drivers/serial/8250_accent.c
index 1f2c276063ef..9c10262f2469 100644
--- a/drivers/serial/8250_accent.c
+++ b/drivers/serial/8250_accent.c
@@ -29,7 +29,7 @@ static struct plat_serial8250_port accent_data[] = {
29 29
30static struct platform_device accent_device = { 30static struct platform_device accent_device = {
31 .name = "serial8250", 31 .name = "serial8250",
32 .id = 2, 32 .id = PLAT8250_DEV_ACCENT,
33 .dev = { 33 .dev = {
34 .platform_data = accent_data, 34 .platform_data = accent_data,
35 }, 35 },
diff --git a/drivers/serial/8250_boca.c b/drivers/serial/8250_boca.c
index 465c9ea1e7a3..3bfe0f7b26fb 100644
--- a/drivers/serial/8250_boca.c
+++ b/drivers/serial/8250_boca.c
@@ -43,7 +43,7 @@ static struct plat_serial8250_port boca_data[] = {
43 43
44static struct platform_device boca_device = { 44static struct platform_device boca_device = {
45 .name = "serial8250", 45 .name = "serial8250",
46 .id = 3, 46 .id = PLAT8250_DEV_BOCA,
47 .dev = { 47 .dev = {
48 .platform_data = boca_data, 48 .platform_data = boca_data,
49 }, 49 },
diff --git a/drivers/serial/8250_fourport.c b/drivers/serial/8250_fourport.c
index e9b4d908ef42..6375d68b7913 100644
--- a/drivers/serial/8250_fourport.c
+++ b/drivers/serial/8250_fourport.c
@@ -35,7 +35,7 @@ static struct plat_serial8250_port fourport_data[] = {
35 35
36static struct platform_device fourport_device = { 36static struct platform_device fourport_device = {
37 .name = "serial8250", 37 .name = "serial8250",
38 .id = 1, 38 .id = PLAT8250_DEV_FOURPORT,
39 .dev = { 39 .dev = {
40 .platform_data = fourport_data, 40 .platform_data = fourport_data,
41 }, 41 },
diff --git a/drivers/serial/8250_hub6.c b/drivers/serial/8250_hub6.c
index 77f396f84b4c..daf569cd3c8f 100644
--- a/drivers/serial/8250_hub6.c
+++ b/drivers/serial/8250_hub6.c
@@ -40,7 +40,7 @@ static struct plat_serial8250_port hub6_data[] = {
40 40
41static struct platform_device hub6_device = { 41static struct platform_device hub6_device = {
42 .name = "serial8250", 42 .name = "serial8250",
43 .id = 4, 43 .id = PLAT8250_DEV_HUB6,
44 .dev = { 44 .dev = {
45 .platform_data = hub6_data, 45 .platform_data = hub6_data,
46 }, 46 },
diff --git a/drivers/serial/8250_mca.c b/drivers/serial/8250_mca.c
index f0c40d68b8c1..ac205256d5f3 100644
--- a/drivers/serial/8250_mca.c
+++ b/drivers/serial/8250_mca.c
@@ -44,7 +44,7 @@ static struct plat_serial8250_port mca_data[] = {
44 44
45static struct platform_device mca_device = { 45static struct platform_device mca_device = {
46 .name = "serial8250", 46 .name = "serial8250",
47 .id = 5, 47 .id = PLAT8250_DEV_MCA,
48 .dev = { 48 .dev = {
49 .platform_data = mca_data, 49 .platform_data = mca_data,
50 }, 50 },
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index d8a023d804d4..317a979b24de 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -30,6 +30,21 @@ struct plat_serial8250_port {
30}; 30};
31 31
32/* 32/*
33 * Allocate 8250 platform device IDs. Nothing is implied by
34 * the numbering here, except for the legacy entry being -1.
35 */
36enum {
37 PLAT8250_DEV_LEGACY = -1,
38 PLAT8250_DEV_PLATFORM,
39 PLAT8250_DEV_PLATFORM1,
40 PLAT8250_DEV_FOURPORT,
41 PLAT8250_DEV_ACCENT,
42 PLAT8250_DEV_BOCA,
43 PLAT8250_DEV_HUB6,
44 PLAT8250_DEV_MCA,
45};
46
47/*
33 * This should be used by drivers which want to register 48 * This should be used by drivers which want to register
34 * their own 8250 ports without registering their own 49 * their own 8250 ports without registering their own
35 * platform device. Using these will make your driver 50 * platform device. Using these will make your driver