Skip to content

Commit

Permalink
mfd: twl6030: Fix endianness problem in IRQ handler
Browse files Browse the repository at this point in the history
The current TWL 6030 IRQ handler assumes little endianness.
This change makes it endian-neutral.

Signed-off-by: Danke Xie <d.xie@sta.samsung.com>
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Danke Xie authored and Lee Jones committed Jan 21, 2014
1 parent 39fed00 commit 754fa7b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/mfd/twl6030-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data)
int i, ret;
union {
u8 bytes[4];
u32 int_sts;
__le32 int_sts;
} sts;
u32 int_sts; /* sts.int_sts converted to CPU endianness */
struct twl6030_irq *pdata = data;

/* read INT_STS_A, B and C in one shot using a burst read */
Expand All @@ -196,8 +197,9 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data)
if (sts.bytes[2] & 0x10)
sts.bytes[2] |= 0x08;

for (i = 0; sts.int_sts; sts.int_sts >>= 1, i++)
if (sts.int_sts & 0x1) {
int_sts = le32_to_cpu(sts.int_sts);
for (i = 0; int_sts; int_sts >>= 1, i++)
if (int_sts & 0x1) {
int module_irq =
irq_find_mapping(pdata->irq_domain,
pdata->irq_mapping_tbl[i]);
Expand Down

0 comments on commit 754fa7b

Please sign in to comment.