mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mfd: Fix off by one in WM831x IRQ code
@ 2011-06-21 23:23 Mark Brown
  2011-07-04 14:19 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2011-06-21 23:23 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, patches, Dimitris Papastamos, Mark Brown

From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

The GPIO IRQs aren't the first IRQs defined, we need to subtract the base
for the GPIOs as well to use them for array indexes.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm831x-irq.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c
index 1808deb..6c3408c 100644
--- a/drivers/mfd/wm831x-irq.c
+++ b/drivers/mfd/wm831x-irq.c
@@ -408,6 +408,11 @@ static int wm831x_irq_set_type(struct irq_data *data, unsigned int type)
 			return -EINVAL;
 	}
 
+	/* Rebase the IRQ into the GPIO range so we've got a sensible array
+	 * index.
+	 */
+	irq -= WM831X_IRQ_GPIO_1;
+
 	/* We set the high bit to flag that we need an update; don't
 	 * do the update here as we can be called with the bus lock
 	 * held.
-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mfd: Fix off by one in WM831x IRQ code
  2011-06-21 23:23 [PATCH] mfd: Fix off by one in WM831x IRQ code Mark Brown
@ 2011-07-04 14:19 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2011-07-04 14:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, patches, Dimitris Papastamos

Hi Mark,

On Wed, Jun 22, 2011 at 12:23:08AM +0100, Mark Brown wrote:
> From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
> 
> The GPIO IRQs aren't the first IRQs defined, we need to subtract the base
> for the GPIOs as well to use them for array indexes.
Patch applied to my for-next branch, thanks.

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:[~2011-07-04 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-21 23:23 [PATCH] mfd: Fix off by one in WM831x IRQ code Mark Brown
2011-07-04 14:19 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®