summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/asic3.c
diff options
context:
space:
mode:
authorDmitry Artamonow <mad_soft@inbox.ru>2012-04-12 13:33:34 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-04-16 18:57:26 +0200
commit02269ab10f1130d35dc35db72ab026d16ba31abf (patch)
treeeb6663b963cf6e5fd127ae19e6fb0e611780080e /drivers/mfd/asic3.c
parentARM: OMAP3: USB: Fix the EHCI ULPI PHY reset issue (diff)
downloadlinux-02269ab10f1130d35dc35db72ab026d16ba31abf.tar.xz
linux-02269ab10f1130d35dc35db72ab026d16ba31abf.zip
mfd: Fix asic3_gpio_to_irq
Assumption that irq numbers of asic3 gpios start at IRQ_BOARD_START is certainly wrong - driver may as well use any other base for its irqs (consider for example the imaginary case of two ASIC3 chips onboard) Furthermore, some platforms even don't have IRQ_BOARD_START defined, so driver will fail to build on them: ------------------------------------------------------- drivers/mfd/asic3.c: In function 'asic3_gpio_to_irq': drivers/mfd/asic3.c:530: error: 'IRQ_BOARD_START' undeclared (first use in this function) drivers/mfd/asic3.c:530: error: (Each undeclared identifier is reported only once drivers/mfd/asic3.c:530: error: for each function it appears in.) ------------------------------------------------------- Fix it by using irq_base from driver data. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/asic3.c')
-rw-r--r--drivers/mfd/asic3.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 1895cf9fab8c..1582c3d95257 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -527,7 +527,9 @@ static void asic3_gpio_set(struct gpio_chip *chip,
static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
- return (offset < ASIC3_NUM_GPIOS) ? IRQ_BOARD_START + offset : -ENXIO;
+ struct asic3 *asic = container_of(chip, struct asic3, gpio);
+
+ return (offset < ASIC3_NUM_GPIOS) ? asic->irq_base + offset : -ENXIO;
}
static __init int asic3_gpio_probe(struct platform_device *pdev,