gpio: stmpe: pass DT node to irqdomain

Message ID 1362139302-23048-1-git-send-email-linus.walleij@stericsson.com
State New
Headers show

Commit Message

Linus Walleij March 1, 2013, 12:01 p.m.
From: Gabriel Fernandez <gabriel.fernandez@stericsson.com>

The irq domain was implemented but the device tree
node was not transmitted to irq_domain_add_simple().

Cc: stable@vger.kernel.org
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-stmpe.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index 770476a..73b691c 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -309,9 +309,11 @@  static const struct irq_domain_ops stmpe_gpio_irq_simple_ops = {
 
 static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio)
 {
-	int base = stmpe_gpio->irq_base;
+	int base = 0;
+	if (!stmpe_gpio->chip.of_node)
+		base = stmpe_gpio->irq_base;
 
-	stmpe_gpio->domain = irq_domain_add_simple(NULL,
+	stmpe_gpio->domain = irq_domain_add_simple(stmpe_gpio->chip.of_node,
 				stmpe_gpio->chip.ngpio, base,
 				&stmpe_gpio_irq_simple_ops, stmpe_gpio);
 	if (!stmpe_gpio->domain) {
@@ -346,6 +348,7 @@  static int stmpe_gpio_probe(struct platform_device *pdev)
 	stmpe_gpio->chip = template_chip;
 	stmpe_gpio->chip.ngpio = stmpe->num_gpios;
 	stmpe_gpio->chip.dev = &pdev->dev;
+	stmpe_gpio->chip.of_node = np;
 	stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1;
 
 	if (pdata)