ARM: at91: gpio make struct at91_gpio_bank an initdata
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Mon, 17 Oct 2011 06:28:38 +0000 (14:28 +0800)
committerArnd Bergmann <arnd@arndb.de>
Tue, 29 Nov 2011 15:46:13 +0000 (15:46 +0000)
this will simplify the switch to the DT and later to the platform_device

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
arch/arm/mach-at91/at91cap9.c
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/gpio.c

index f7f7e1e..506a26c 100644 (file)
@@ -298,7 +298,7 @@ void __init at91cap9_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91cap9_gpio[] = {
+static struct at91_gpio_bank at91cap9_gpio[] __initdata = {
        {
                .id             = AT91CAP9_ID_PIOABCD,
                .regbase        = AT91CAP9_BASE_PIOA,
index 7470f63..9163d7d 100644 (file)
@@ -273,7 +273,7 @@ void __init at91rm9200_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91rm9200_gpio[] = {
+static struct at91_gpio_bank at91rm9200_gpio[] __initdata = {
        {
                .id             = AT91RM9200_ID_PIOA,
                .regbase        = AT91RM9200_BASE_PIOA,
index 943da21..3f6c6a1 100644 (file)
@@ -274,7 +274,7 @@ void __init at91sam9260_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9260_gpio[] = {
+static struct at91_gpio_bank at91sam9260_gpio[] __initdata = {
        {
                .id             = AT91SAM9260_ID_PIOA,
                .regbase        = AT91SAM9260_BASE_PIOA,
index dd7924c..a0538c5 100644 (file)
@@ -253,7 +253,7 @@ void __init at91sam9261_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9261_gpio[] = {
+static struct at91_gpio_bank at91sam9261_gpio[] __initdata = {
        {
                .id             = AT91SAM9261_ID_PIOA,
                .regbase        = AT91SAM9261_BASE_PIOA,
index 5a74741..5ffbbb0 100644 (file)
@@ -269,7 +269,7 @@ void __init at91sam9263_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9263_gpio[] = {
+static struct at91_gpio_bank at91sam9263_gpio[] __initdata = {
        {
                .id             = AT91SAM9263_ID_PIOA,
                .regbase        = AT91SAM9263_BASE_PIOA,
index 4bb0bf0..f61eb64 100644 (file)
@@ -299,7 +299,7 @@ void __init at91sam9g45_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9g45_gpio[] = {
+static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = {
        {
                .id             = AT91SAM9G45_ID_PIOA,
                .regbase        = AT91SAM9G45_BASE_PIOA,
index 60555d4..96247f6 100644 (file)
@@ -246,7 +246,7 @@ void __init at91sam9rl_set_console_clock(int id)
  *  GPIO
  * -------------------------------------------------------------------- */
 
-static struct at91_gpio_bank at91sam9rl_gpio[] = {
+static struct at91_gpio_bank at91sam9rl_gpio[] __initdata = {
        {
                .id             = AT91SAM9RL_ID_PIOA,
                .regbase        = AT91SAM9RL_BASE_PIOA,
index 4059f07..163c724 100644 (file)
@@ -29,7 +29,7 @@
 struct at91_gpio_chip {
        struct gpio_chip        chip;
        struct at91_gpio_chip   *next;          /* Bank sharing same clock */
-       struct at91_gpio_bank   *bank;          /* Bank definition */
+       int                     id;             /* ID of register bank */
        void __iomem            *regbase;       /* Base of register bank */
        struct clk              *clock;         /* associated clock */
 };
@@ -286,7 +286,7 @@ static int gpio_irq_set_wake(struct irq_data *d, unsigned state)
        else
                wakeups[bank] &= ~mask;
 
-       irq_set_irq_wake(gpio_chip[bank].bank->id, state);
+       irq_set_irq_wake(gpio_chip[bank].id, state);
 
        return 0;
 }
@@ -498,7 +498,7 @@ void __init at91_gpio_irq_setup(void)
        for (pioc = 0, pin = PIN_BASE, this = gpio_chip, prev = NULL;
                        pioc++ < gpio_banks;
                        prev = this, this++) {
-               unsigned        id = this->bank->id;
+               unsigned        id = this->id;
                unsigned        i;
 
                __raw_writel(~0, this->regbase + PIO_IDR);
@@ -613,10 +613,10 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
        for (i = 0; i < nr_banks; i++) {
                at91_gpio = &gpio_chip[i];
 
-               at91_gpio->bank = &data[i];
+               at91_gpio->id = data[i].id;
                at91_gpio->chip.base = PIN_BASE + i * 32;
 
-               at91_gpio->regbase = ioremap(at91_gpio->bank->regbase, 512);
+               at91_gpio->regbase = ioremap(data[i].regbase, 512);
                if (!at91_gpio->regbase) {
                        pr_err("at91_gpio.%d, failed to map registers, ignoring.\n", i);
                        continue;
@@ -632,7 +632,7 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
                clk_enable(at91_gpio->clock);
 
                /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */
-               if (last && last->bank->id == at91_gpio->bank->id)
+               if (last && last->id == at91_gpio->id)
                        last->next = at91_gpio;
                last = at91_gpio;