Commit a1b478e8 authored by Arnd Bergmann's avatar Arnd Bergmann

ARM: msm: use __iomem pointers for MMIO

ARM is moving to stricter checks on readl/write functions,
so we need to use the correct types everywhere.
Acked-by: default avatarDavid Brown <davidb@codeaurora.org>
Acked-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent df38b24f
...@@ -52,13 +52,14 @@ static int msm_smd_debug_mask; ...@@ -52,13 +52,14 @@ static int msm_smd_debug_mask;
struct shared_info { struct shared_info {
int ready; int ready;
unsigned state; void __iomem *state;
}; };
static unsigned dummy_state[SMSM_STATE_COUNT]; static unsigned dummy_state[SMSM_STATE_COUNT];
static struct shared_info smd_info = { static struct shared_info smd_info = {
.state = (unsigned) &dummy_state, /* FIXME: not a real __iomem pointer */
.state = &dummy_state,
}; };
module_param_named(debug_mask, msm_smd_debug_mask, module_param_named(debug_mask, msm_smd_debug_mask,
...@@ -796,22 +797,22 @@ void *smem_alloc(unsigned id, unsigned size) ...@@ -796,22 +797,22 @@ void *smem_alloc(unsigned id, unsigned size)
return smem_find(id, size); return smem_find(id, size);
} }
void *smem_item(unsigned id, unsigned *size) void __iomem *smem_item(unsigned id, unsigned *size)
{ {
struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE; struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE;
struct smem_heap_entry *toc = shared->heap_toc; struct smem_heap_entry *toc = shared->heap_toc;
if (id >= SMEM_NUM_ITEMS) if (id >= SMEM_NUM_ITEMS)
return 0; return NULL;
if (toc[id].allocated) { if (toc[id].allocated) {
*size = toc[id].size; *size = toc[id].size;
return (void *) (MSM_SHARED_RAM_BASE + toc[id].offset); return (MSM_SHARED_RAM_BASE + toc[id].offset);
} else { } else {
*size = 0; *size = 0;
} }
return 0; return NULL;
} }
void *smem_find(unsigned id, unsigned size_in) void *smem_find(unsigned id, unsigned size_in)
...@@ -857,7 +858,7 @@ static irqreturn_t smsm_irq_handler(int irq, void *data) ...@@ -857,7 +858,7 @@ static irqreturn_t smsm_irq_handler(int irq, void *data)
int smsm_change_state(enum smsm_state_item item, int smsm_change_state(enum smsm_state_item item,
uint32_t clear_mask, uint32_t set_mask) uint32_t clear_mask, uint32_t set_mask)
{ {
unsigned long addr = smd_info.state + item * 4; void __iomem *addr = smd_info.state + item * 4;
unsigned long flags; unsigned long flags;
unsigned state; unsigned state;
...@@ -943,10 +944,10 @@ int smd_core_init(void) ...@@ -943,10 +944,10 @@ int smd_core_init(void)
/* wait for essential items to be initialized */ /* wait for essential items to be initialized */
for (;;) { for (;;) {
unsigned size; unsigned size;
void *state; void __iomem *state;
state = smem_item(SMEM_SMSM_SHARED_STATE, &size); state = smem_item(SMEM_SMSM_SHARED_STATE, &size);
if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) { if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) {
smd_info.state = (unsigned)state; smd_info.state = state;
break; break;
} }
} }
......
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