mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] at91: at91_register_uart use number instead of IDs
Date: Tue, 24 Apr 2012 12:15:20 +0200	[thread overview]
Message-ID: <1335262521-26145-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20120424100916.GX20601@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/mach-at91/at91rm9200_devices.c  |   13 ++++---------
 arch/arm/mach-at91/at91sam9260_devices.c |   19 ++++++-------------
 arch/arm/mach-at91/at91sam9261_devices.c |   10 +++-------
 arch/arm/mach-at91/at91sam9263_devices.c |   10 +++-------
 arch/arm/mach-at91/at91sam9g45_devices.c |   13 ++++---------
 5 files changed, 20 insertions(+), 45 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index c380c7d..7e721e5 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -273,27 +273,22 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91RM9200_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91RM9200_BASE_US0;
-			id = 1;
 			break;
-		case AT91RM9200_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91RM9200_BASE_US1;
-			id = 2;
 			break;
-		case AT91RM9200_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91RM9200_BASE_US2;
-			id = 3;
 			break;
-		case AT91RM9200_ID_US3:
+		case 4:
 			configure_usart3_pins(pins);
 			start = AT91RM9200_BASE_US3;
-			id = 4;
 			break;
 		default:
 			return NULL;
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 23da8c1..17dbd1a 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -290,37 +290,30 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91SAM9260_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91SAM9260_BASE_US0;
-			id = 1;
 			break;
-		case AT91SAM9260_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91SAM9260_BASE_US1;
-			id = 2;
 			break;
-		case AT91SAM9260_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91SAM9260_BASE_US2;
-			id = 3;
 			break;
-		case AT91SAM9260_ID_US3:
+		case 4:
 			configure_usart3_pins(pins);
 			start = AT91SAM9260_BASE_US3;
-			id = 4;
 			break;
-		case AT91SAM9260_ID_US4:
+		case 5:
 			configure_usart4_pins();
 			start = AT91SAM9260_BASE_US4;
-			id = 5;
 			break;
-		case AT91SAM9260_ID_US5:
+		case 6:
 			configure_usart5_pins();
 			start = AT91SAM9260_BASE_US5;
-			id = 6;
 			break;
 		default:
 			return NULL;
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index d4f7b5e..8a63d2a 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -211,22 +211,18 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91SAM9261_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91SAM9261_BASE_US0;
-			id = 1;
 			break;
-		case AT91SAM9261_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91SAM9261_BASE_US1;
-			id = 2;
 			break;
-		case AT91SAM9261_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91SAM9261_BASE_US2;
-			id = 3;
 			break;
 		default:
 			return NULL;
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 12d6a24..b28e9e2 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -261,22 +261,18 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91SAM9263_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91SAM9263_BASE_US0;
-			id = 1;
 			break;
-		case AT91SAM9263_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91SAM9263_BASE_US1;
-			id = 2;
 			break;
-		case AT91SAM9263_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91SAM9263_BASE_US2;
-			id = 3;
 			break;
 		default:
 			return NULL;
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 25a8d80..ca96f58 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -190,27 +190,22 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91SAM9G45_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91SAM9G45_BASE_US0;
-			id = 1;
 			break;
-		case AT91SAM9G45_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91SAM9G45_BASE_US1;
-			id = 2;
 			break;
-		case AT91SAM9G45_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91SAM9G45_BASE_US2;
-			id = 3;
 			break;
-		case AT91SAM9G45_ID_US3:
+		case 4:
 			configure_usart3_pins(pins);
 			start = AT91SAM9G45_BASE_US3;
-			id = 4;
 			break;
 		default:
 			return NULL;
-- 
1.7.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-04-24 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 10:09 [FIXES Master] tny-a926x fixes Jean-Christophe PLAGNIOL-VILLARD
2012-04-24 10:15 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-04-24 10:15 ` [PATCH 2/2] tny-a926x: fix MOB-TNY-MD2 Motherboard support Jean-Christophe PLAGNIOL-VILLARD
2012-04-24 13:20 ` [FIXES Master] tny-a926x fixes Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335262521-26145-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox