]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] 4908/1: [AT91] RTT platform_device fix
authorAndrew Victor <linux@maxim.org.za>
Wed, 2 Apr 2008 20:55:19 +0000 (21:55 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 4 Apr 2008 08:52:24 +0000 (09:52 +0100)
The RTT-as-RTC driver will search for the user-specified RTT
peripheral via ID number (0 .. 1).
Therefore if the processor only contains a single RTT peripheral, we
need to set its platform_device.id to "0" instead of "-1".
Also add the missing platform_device resource for the CAP9 processor.

Bug reported by Sedji Gaouaou.

Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-at91/at91cap9_devices.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9rl_devices.c

index 10f15f3a56cab3bdab14d2ffb58b801931945f1f..7d782ee4117b8cc529ab67c5d66e43b9008c4c50 100644 (file)
@@ -540,10 +540,19 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
  *  RTT
  * -------------------------------------------------------------------- */
 
+static struct resource rtt_resources[] = {
+       {
+               .start  = AT91_BASE_SYS + AT91_RTT,
+               .end    = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
 static struct platform_device at91cap9_rtt_device = {
        .name           = "at91_rtt",
-       .id             = -1,
-       .num_resources  = 0,
+       .id             = 0,
+       .resource       = rtt_resources,
+       .num_resources  = ARRAY_SIZE(rtt_resources),
 };
 
 static void __init at91_add_device_rtt(void)
index d613761dc2f8e624edc5e7b095e038c4a0b72b7f..f20afe4d156c35a3a32d62e15347b21f9ffd72e6 100644 (file)
@@ -558,7 +558,7 @@ static struct resource rtt_resources[] = {
 
 static struct platform_device at91sam9260_rtt_device = {
        .name           = "at91_rtt",
-       .id             = -1,
+       .id             = 0,
        .resource       = rtt_resources,
        .num_resources  = ARRAY_SIZE(rtt_resources),
 };
index 48ecbeffd9b04fa834f421d03008a86b958a494d..0bd0edf8fa3bdce56c8be5609daa50e2756f55d0 100644 (file)
@@ -561,7 +561,7 @@ static struct resource rtt_resources[] = {
 
 static struct platform_device at91sam9261_rtt_device = {
        .name           = "at91_rtt",
-       .id             = -1,
+       .id             = 0,
        .resource       = rtt_resources,
        .num_resources  = ARRAY_SIZE(rtt_resources),
 };
index 2a0abd25e7734280c1b2bff70cf11af8ab1d8e30..8982b02c8b46df62036e8a1ea912c41a9272e1c9 100644 (file)
@@ -423,7 +423,7 @@ static struct resource rtt_resources[] = {
 
 static struct platform_device at91sam9rl_rtt_device = {
        .name           = "at91_rtt",
-       .id             = -1,
+       .id             = 0,
        .resource       = rtt_resources,
        .num_resources  = ARRAY_SIZE(rtt_resources),
 };