OSDN Git Service

[SERIAL] Use an enum for serial8250 platform device IDs
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Thu, 8 Sep 2005 15:04:41 +0000 (16:04 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 8 Sep 2005 15:04:41 +0000 (16:04 +0100)
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>
26 files changed:
arch/arm/mach-clps7500/core.c
arch/arm/mach-ebsa110/core.c
arch/arm/mach-epxa10db/arch.c
arch/arm/mach-footbridge/isa.c
arch/arm/mach-h720x/cpu-h7202.c
arch/arm/mach-ixp2000/core.c
arch/arm/mach-ixp4xx/coyote-setup.c
arch/arm/mach-ixp4xx/gtwx5715-setup.c
arch/arm/mach-ixp4xx/ixdp425-setup.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap1/serial.c
arch/arm/mach-rpc/riscpc.c
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-vr1000.c
arch/arm/mach-shark/core.c
arch/ppc/syslib/mpc10x_common.c
arch/ppc/syslib/mpc83xx_devices.c
arch/ppc/syslib/mpc85xx_devices.c
arch/ppc64/kernel/setup.c
drivers/serial/8250.c
drivers/serial/8250_accent.c
drivers/serial/8250_boca.c
drivers/serial/8250_fourport.c
drivers/serial/8250_hub6.c
drivers/serial/8250_mca.c
include/linux/serial_8250.h

index 112f1d6..e216ab8 100644 (file)
@@ -354,7 +354,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index 23c4da1..5aeadfd 100644 (file)
@@ -219,7 +219,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index 7daa021..44c5657 100644 (file)
@@ -52,7 +52,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index aa3a1fe..28846c7 100644 (file)
@@ -34,7 +34,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index 4b31993..a4a7c01 100644 (file)
@@ -90,7 +90,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index 098c817..74bd2fd 100644 (file)
@@ -174,7 +174,7 @@ static struct resource ixp2000_uart_resource = {
 
 static struct platform_device ixp2000_serial_device = {
        .name           = "serial8250",
-       .id             = 0,
+       .id             = PLAT8250_DEV_PLATFORM,
        .dev            = {
                .platform_data          = ixp2000_serial_port,
        },
index 8b2f253..050c927 100644 (file)
@@ -66,7 +66,7 @@ static struct plat_serial8250_port coyote_uart_data[] = {
 
 static struct platform_device coyote_uart = {
        .name           = "serial8250",
-       .id             = 0,
+       .id             = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = coyote_uart_data,
        },
index 3fd92c5..29a6d02 100644 (file)
@@ -93,7 +93,7 @@ static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
 
 static struct platform_device gtwx5715_uart_device = {
        .name           = "serial8250",
-       .id             = 0,
+       .id             = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = gtwx5715_uart_platform_data,
        },
index 6c14ff3..ae1fa09 100644 (file)
@@ -96,7 +96,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = {
 
 static struct platform_device ixdp425_uart = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev.platform_data      = ixdp425_uart_data,
        .num_resources          = 2,
        .resource               = ixdp425_uart_resources
index e422819..76176dd 100644 (file)
@@ -74,7 +74,7 @@ static struct plat_serial8250_port voiceblue_ports[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 1,
+       .id                     = PLAT8250_DEV_PLATFORM1,
        .dev                    = {
                .platform_data  = voiceblue_ports,
        },
index 214e5d1..1446bf3 100644 (file)
@@ -94,7 +94,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index a102686..e3587ef 100644 (file)
@@ -140,7 +140,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index e918224..1a3367d 100644 (file)
@@ -381,7 +381,7 @@ static struct plat_serial8250_port bast_sio_data[] = {
 
 static struct platform_device bast_sio = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = &bast_sio_data,
        },
index 924e846..8f9ab28 100644 (file)
@@ -221,7 +221,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index e737eae..946c0d1 100644 (file)
@@ -41,7 +41,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
index 87065e2..3e03970 100644 (file)
@@ -140,12 +140,12 @@ struct platform_device ppc_sys_platform_devices[] = {
        },
        [MPC10X_UART0] = {
                .name = "serial8250",
-               .id     = 0,
+               .id     = PLAT8250_DEV_PLATFORM,
                .dev.platform_data = serial_plat_uart0,
        },
        [MPC10X_UART1] = {
                .name = "serial8250",
-               .id     = 1,
+               .id     = PLAT8250_DEV_PLATFORM1,
                .dev.platform_data = serial_plat_uart1,
        },
 
index 5aaf0e5..95b3b8a 100644 (file)
@@ -165,7 +165,7 @@ struct platform_device ppc_sys_platform_devices[] = {
        },
        [MPC83xx_DUART] = {
                .name = "serial8250",
-               .id     = 0,
+               .id     = PLAT8250_DEV_PLATFORM,
                .dev.platform_data = serial_platform_data,
        },
        [MPC83xx_SEC2] = {
index 8af322d..bbc5ac0 100644 (file)
@@ -282,7 +282,7 @@ struct platform_device ppc_sys_platform_devices[] = {
        },
        [MPC85xx_DUART] = {
                .name = "serial8250",
-               .id     = 0,
+               .id     = PLAT8250_DEV_PLATFORM,
                .dev.platform_data = serial_platform_data,
        },
        [MPC85xx_PERFMON] = {
index d0bb68a..bfa8791 100644 (file)
@@ -1283,7 +1283,7 @@ void __init generic_find_legacy_serial_ports(u64 *physport,
 
 static struct platform_device serial_device = {
        .name   = "serial8250",
-       .id     = 0,
+       .id     = PLAT8250_DEV_PLATFORM,
        .dev    = {
                .platform_data = serial_ports,
        },
index 30a0a3d..5b65e20 100644 (file)
@@ -2536,7 +2536,7 @@ static int __init serial8250_init(void)
                goto out;
 
        serial8250_isa_devs = platform_device_register_simple("serial8250",
-                                                             -1, NULL, 0);
+                                        PLAT8250_DEV_LEGACY, NULL, 0);
        if (IS_ERR(serial8250_isa_devs)) {
                ret = PTR_ERR(serial8250_isa_devs);
                goto unreg;
index 1f2c276..9c10262 100644 (file)
@@ -29,7 +29,7 @@ static struct plat_serial8250_port accent_data[] = {
 
 static struct platform_device accent_device = {
        .name                   = "serial8250",
-       .id                     = 2,
+       .id                     = PLAT8250_DEV_ACCENT,
        .dev                    = {
                .platform_data  = accent_data,
        },
index 465c9ea..3bfe0f7 100644 (file)
@@ -43,7 +43,7 @@ static struct plat_serial8250_port boca_data[] = {
 
 static struct platform_device boca_device = {
        .name                   = "serial8250",
-       .id                     = 3,
+       .id                     = PLAT8250_DEV_BOCA,
        .dev                    = {
                .platform_data  = boca_data,
        },
index e9b4d90..6375d68 100644 (file)
@@ -35,7 +35,7 @@ static struct plat_serial8250_port fourport_data[] = {
 
 static struct platform_device fourport_device = {
        .name                   = "serial8250",
-       .id                     = 1,
+       .id                     = PLAT8250_DEV_FOURPORT,
        .dev                    = {
                .platform_data  = fourport_data,
        },
index 77f396f..daf569c 100644 (file)
@@ -40,7 +40,7 @@ static struct plat_serial8250_port hub6_data[] = {
 
 static struct platform_device hub6_device = {
        .name                   = "serial8250",
-       .id                     = 4,
+       .id                     = PLAT8250_DEV_HUB6,
        .dev                    = {
                .platform_data  = hub6_data,
        },
index f0c40d6..ac20525 100644 (file)
@@ -44,7 +44,7 @@ static struct plat_serial8250_port mca_data[] = {
 
 static struct platform_device mca_device = {
        .name                   = "serial8250",
-       .id                     = 5,
+       .id                     = PLAT8250_DEV_MCA,
        .dev                    = {
                .platform_data  = mca_data,
        },
index d8a023d..317a979 100644 (file)
@@ -30,6 +30,21 @@ struct plat_serial8250_port {
 };
 
 /*
+ * Allocate 8250 platform device IDs.  Nothing is implied by
+ * the numbering here, except for the legacy entry being -1.
+ */
+enum {
+       PLAT8250_DEV_LEGACY = -1,
+       PLAT8250_DEV_PLATFORM,
+       PLAT8250_DEV_PLATFORM1,
+       PLAT8250_DEV_FOURPORT,
+       PLAT8250_DEV_ACCENT,
+       PLAT8250_DEV_BOCA,
+       PLAT8250_DEV_HUB6,
+       PLAT8250_DEV_MCA,
+};
+
+/*
  * This should be used by drivers which want to register
  * their own 8250 ports without registering their own
  * platform device.  Using these will make your driver