Skip to content

Commit

Permalink
ARM: at91: gpio make struct at91_gpio_bank an initdata
Browse files Browse the repository at this point in the history
this will simplify the switch to the DT and later to the platform_device

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
  • Loading branch information
Jean-Christophe PLAGNIOL-VILLARD authored and Arnd Bergmann committed Nov 29, 2011
1 parent 619d4a4 commit 1a2d915
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/at91cap9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/at91rm9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/at91sam9260.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/at91sam9261.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/at91sam9263.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/at91sam9g45.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/at91sam9rl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mach-at91/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
};
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 1a2d915

Please sign in to comment.