diff options
author | Danke Xie <d.xie@sta.samsung.com> | 2013-12-23 12:11:46 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-01-21 03:28:57 -0500 |
commit | 754fa7bc9852f17d3c79b93747b643e1665ce0de (patch) | |
tree | 0f42d5c2c0e2309767dccc19b23b4495cecd2ce8 /drivers/mfd | |
parent | 39fed00f0b91f4ee595ac719f3bc2d226ed111b9 (diff) |
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: 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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/twl6030-irq.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c index 517eda832f79..18a607e2ca06 100644 --- a/drivers/mfd/twl6030-irq.c +++ b/drivers/mfd/twl6030-irq.c | |||
@@ -176,8 +176,9 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data) | |||
176 | int i, ret; | 176 | int i, ret; |
177 | union { | 177 | union { |
178 | u8 bytes[4]; | 178 | u8 bytes[4]; |
179 | u32 int_sts; | 179 | __le32 int_sts; |
180 | } sts; | 180 | } sts; |
181 | u32 int_sts; /* sts.int_sts converted to CPU endianness */ | ||
181 | struct twl6030_irq *pdata = data; | 182 | struct twl6030_irq *pdata = data; |
182 | 183 | ||
183 | /* read INT_STS_A, B and C in one shot using a burst read */ | 184 | /* 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 | if (sts.bytes[2] & 0x10) | 197 | if (sts.bytes[2] & 0x10) |
197 | sts.bytes[2] |= 0x08; | 198 | sts.bytes[2] |= 0x08; |
198 | 199 | ||
199 | for (i = 0; sts.int_sts; sts.int_sts >>= 1, i++) | 200 | int_sts = le32_to_cpu(sts.int_sts); |
200 | if (sts.int_sts & 0x1) { | 201 | for (i = 0; int_sts; int_sts >>= 1, i++) |
202 | if (int_sts & 0x1) { | ||
201 | int module_irq = | 203 | int module_irq = |
202 | irq_find_mapping(pdata->irq_domain, | 204 | irq_find_mapping(pdata->irq_domain, |
203 | pdata->irq_mapping_tbl[i]); | 205 | pdata->irq_mapping_tbl[i]); |