Commit 754fa7bc authored by Danke Xie's avatar Danke Xie Committed by Lee Jones

mfd: twl6030: Fix endianness problem in IRQ handler

The current TWL 6030 IRQ handler assumes little endianness.
This change makes it endian-neutral.
Signed-off-by: default avatarDanke Xie <d.xie@sta.samsung.com>
Signed-off-by: default avatarTaras Kondratiuk <taras.kondratiuk@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 39fed00f
...@@ -176,8 +176,9 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data) ...@@ -176,8 +176,9 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data)
int i, ret; int i, ret;
union { union {
u8 bytes[4]; u8 bytes[4];
u32 int_sts; __le32 int_sts;
} sts; } sts;
u32 int_sts; /* sts.int_sts converted to CPU endianness */
struct twl6030_irq *pdata = data; struct twl6030_irq *pdata = data;
/* read INT_STS_A, B and C in one shot using a burst read */ /* read INT_STS_A, B and C in one shot using a burst read */
...@@ -196,8 +197,9 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data) ...@@ -196,8 +197,9 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data)
if (sts.bytes[2] & 0x10) if (sts.bytes[2] & 0x10)
sts.bytes[2] |= 0x08; sts.bytes[2] |= 0x08;
for (i = 0; sts.int_sts; sts.int_sts >>= 1, i++) int_sts = le32_to_cpu(sts.int_sts);
if (sts.int_sts & 0x1) { for (i = 0; int_sts; int_sts >>= 1, i++)
if (int_sts & 0x1) {
int module_irq = int module_irq =
irq_find_mapping(pdata->irq_domain, irq_find_mapping(pdata->irq_domain,
pdata->irq_mapping_tbl[i]); pdata->irq_mapping_tbl[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment