gpio: palmas: use palmas API for getting irq
Laxman Dewangan [Tue, 12 Mar 2013 08:32:39 +0000 (13:32 +0530)]
To get the irq number for given gpio, use the palmas API
palmas_irq_get_virq() in place of directly using regmap API.

Change-Id: I2305b6c6c852a914efd08c4e020dba4301bd83fc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/208339
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>

drivers/gpio/gpio-palmas.c

index c627f2b..9150f55 100644 (file)
@@ -133,11 +133,7 @@ static int palmas_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
        struct palmas_gpio *palmas_gpio = to_palmas_gpio(chip);
        struct palmas *palmas = palmas_gpio->palmas;
 
-       if (!regmap_irq_chip_get_base(palmas->irq_data))
-               return -EINVAL;
-
-       return (regmap_irq_chip_get_base(palmas->irq_data))
-                               + PALMAS_GPIO_0_IRQ + offset;
+       return palmas_irq_get_virq(palmas, PALMAS_GPIO_0_IRQ + offset);
 }
 
 static int palmas_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,