aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2012-02-13 05:26:25 -0500
committerNicolas Ferre <nicolas.ferre@atmel.com>2012-03-01 07:29:01 -0500
commit5bc067b71928d3f470d051847aefa55724fd0c95 (patch)
tree429f233b33053584cecd7204c9c22b61eb561516
parent21f81872788b8089ec4214afad8fc6a0a23f70c8 (diff)
ARM: at91/gpio: non-DT builds do not have gpio_chip.of_node field
Protect build failure in case of non-DT configuration: the gpio_chip structure does not have a of_node field in case of !CONFIG_OF_GPIO. Keep this in a separate patch as it can be reverted if the field is added for both DT/non-DT cases. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
-rw-r--r--arch/arm/mach-at91/gpio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index 89e683aaae6c..0dc3f5ead7bb 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -496,12 +496,17 @@ postcore_initcall(at91_gpio_debugfs_init);
496static void __init at91_gpio_irqdomain(struct at91_gpio_chip *at91_gpio) 496static void __init at91_gpio_irqdomain(struct at91_gpio_chip *at91_gpio)
497{ 497{
498 int irq_base; 498 int irq_base;
499#if defined(CONFIG_OF)
500 struct device_node *of_node = at91_gpio->chip.of_node;
501#else
502 struct device_node *of_node = NULL;
503#endif
499 504
500 irq_base = irq_alloc_descs(-1, 0, at91_gpio->chip.ngpio, 0); 505 irq_base = irq_alloc_descs(-1, 0, at91_gpio->chip.ngpio, 0);
501 if (irq_base < 0) 506 if (irq_base < 0)
502 panic("at91_gpio.%d: error %d: couldn't allocate IRQ numbers.\n", 507 panic("at91_gpio.%d: error %d: couldn't allocate IRQ numbers.\n",
503 at91_gpio->pioc_idx, irq_base); 508 at91_gpio->pioc_idx, irq_base);
504 at91_gpio->domain = irq_domain_add_legacy(at91_gpio->chip.of_node, 509 at91_gpio->domain = irq_domain_add_legacy(of_node,
505 at91_gpio->chip.ngpio, 510 at91_gpio->chip.ngpio,
506 irq_base, 0, 511 irq_base, 0,
507 &irq_domain_simple_ops, NULL); 512 &irq_domain_simple_ops, NULL);