* [PATCH] Fix asic3 build error
@ 2012-04-14 8:57 Russell King - ARM Linux
2012-04-16 19:11 ` Samuel Ortiz
0 siblings, 1 reply; 2+ messages in thread
From: Russell King - ARM Linux @ 2012-04-14 8:57 UTC (permalink / raw)
To: linux-arm-kernel
OMAP randconfig builds occasionally fail with:
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 asic->irq_base rather than assuming this value is
IRQ_BOARD_START.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
I don't have the ability to do anything but compile test this. Please
check that it's correct. Also, I believe that the check for ASIC3_NUM_GPIOS
is unnecessary - gpiolib won't call your driver if you don't own the GPIO.
drivers/mfd/asic3.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 1895cf9..1582c3d 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,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] Fix asic3 build error
2012-04-14 8:57 [PATCH] Fix asic3 build error Russell King - ARM Linux
@ 2012-04-16 19:11 ` Samuel Ortiz
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2012-04-16 19:11 UTC (permalink / raw)
To: linux-arm-kernel
Hi Russell,
On Sat, Apr 14, 2012 at 09:57:09AM +0100, Russell King - ARM Linux wrote:
> OMAP randconfig builds occasionally fail with:
>
> 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 asic->irq_base rather than assuming this value is
> IRQ_BOARD_START.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Dmitry Artamonow sent the same fix a few days ago and it's now part of my
for-linus branch.
> ---
> I don't have the ability to do anything but compile test this. Please
> check that it's correct. Also, I believe that the check for ASIC3_NUM_GPIOS
> is unnecessary - gpiolib won't call your driver if you don't own the GPIO.
Yes, you're right. __gpio_to_irq() call gpio_to_chip(), so I should only
receive requests for GPIOs I own. I'll fix that up as well.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-16 19:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-14 8:57 [PATCH] Fix asic3 build error Russell King - ARM Linux
2012-04-16 19:11 ` Samuel Ortiz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox