summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/sh/intc/access.c45
-rw-r--r--drivers/sh/intc/chip.c4
-rw-r--r--drivers/tty/serial/sh-sci.c3
3 files changed, 31 insertions, 21 deletions
diff --git a/drivers/sh/intc/access.c b/drivers/sh/intc/access.c
index f892ae1d212a..114390f967d2 100644
--- a/drivers/sh/intc/access.c
+++ b/drivers/sh/intc/access.c
@@ -75,54 +75,61 @@ unsigned long intc_get_field_from_handle(unsigned int value, unsigned int handle
static unsigned long test_8(unsigned long addr, unsigned long h,
unsigned long ignore)
{
- return intc_get_field_from_handle(__raw_readb(addr), h);
+ void __iomem *ptr = (void __iomem *)addr;
+ return intc_get_field_from_handle(__raw_readb(ptr), h);
}
static unsigned long test_16(unsigned long addr, unsigned long h,
unsigned long ignore)
{
- return intc_get_field_from_handle(__raw_readw(addr), h);
+ void __iomem *ptr = (void __iomem *)addr;
+ return intc_get_field_from_handle(__raw_readw(ptr), h);
}
static unsigned long test_32(unsigned long addr, unsigned long h,
unsigned long ignore)
{
- return intc_get_field_from_handle(__raw_readl(addr), h);
+ void __iomem *ptr = (void __iomem *)addr;
+ return intc_get_field_from_handle(__raw_readl(ptr), h);
}
static unsigned long write_8(unsigned long addr, unsigned long h,
unsigned long data)
{
- __raw_writeb(intc_set_field_from_handle(0, data, h), addr);
- (void)__raw_readb(addr); /* Defeat write posting */
+ void __iomem *ptr = (void __iomem *)addr;
+ __raw_writeb(intc_set_field_from_handle(0, data, h), ptr);
+ (void)__raw_readb(ptr); /* Defeat write posting */
return 0;
}
static unsigned long write_16(unsigned long addr, unsigned long h,
unsigned long data)
{
- __raw_writew(intc_set_field_from_handle(0, data, h), addr);
- (void)__raw_readw(addr); /* Defeat write posting */
+ void __iomem *ptr = (void __iomem *)addr;
+ __raw_writew(intc_set_field_from_handle(0, data, h), ptr);
+ (void)__raw_readw(ptr); /* Defeat write posting */
return 0;
}
static unsigned long write_32(unsigned long addr, unsigned long h,
unsigned long data)
{
- __raw_writel(intc_set_field_from_handle(0, data, h), addr);
- (void)__raw_readl(addr); /* Defeat write posting */
+ void __iomem *ptr = (void __iomem *)addr;
+ __raw_writel(intc_set_field_from_handle(0, data, h), ptr);
+ (void)__raw_readl(ptr); /* Defeat write posting */
return 0;
}
static unsigned long modify_8(unsigned long addr, unsigned long h,
unsigned long data)
{
+ void __iomem *ptr = (void __iomem *)addr;
unsigned long flags;
unsigned int value;
local_irq_save(flags);
- value = intc_set_field_from_handle(__raw_readb(addr), data, h);
- __raw_writeb(value, addr);
- (void)__raw_readb(addr); /* Defeat write posting */
+ value = intc_set_field_from_handle(__raw_readb(ptr), data, h);
+ __raw_writeb(value, ptr);
+ (void)__raw_readb(ptr); /* Defeat write posting */
local_irq_restore(flags);
return 0;
}
@@ -130,12 +137,13 @@ static unsigned long modify_8(unsigned long addr, unsigned long h,
static unsigned long modify_16(unsigned long addr, unsigned long h,
unsigned long data)
{
+ void __iomem *ptr = (void __iomem *)addr;
unsigned long flags;
unsigned int value;
local_irq_save(flags);
- value = intc_set_field_from_handle(__raw_readw(addr), data, h);
- __raw_writew(value, addr);
- (void)__raw_readw(addr); /* Defeat write posting */
+ value = intc_set_field_from_handle(__raw_readw(ptr), data, h);
+ __raw_writew(value, ptr);
+ (void)__raw_readw(ptr); /* Defeat write posting */
local_irq_restore(flags);
return 0;
}
@@ -143,12 +151,13 @@ static unsigned long modify_16(unsigned long addr, unsigned long h,
static unsigned long modify_32(unsigned long addr, unsigned long h,
unsigned long data)
{
+ void __iomem *ptr = (void __iomem *)addr;
unsigned long flags;
unsigned int value;
local_irq_save(flags);
- value = intc_set_field_from_handle(__raw_readl(addr), data, h);
- __raw_writel(value, addr);
- (void)__raw_readl(addr); /* Defeat write posting */
+ value = intc_set_field_from_handle(__raw_readl(ptr), data, h);
+ __raw_writel(value, ptr);
+ (void)__raw_readl(ptr); /* Defeat write posting */
local_irq_restore(flags);
return 0;
}
diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
index 012df2676a26..46427b48e2f1 100644
--- a/drivers/sh/intc/chip.c
+++ b/drivers/sh/intc/chip.c
@@ -83,7 +83,7 @@ static void intc_mask_ack(struct irq_data *data)
unsigned int irq = data->irq;
struct intc_desc_int *d = get_intc_desc(irq);
unsigned long handle = intc_get_ack_handle(irq);
- unsigned long addr;
+ void __iomem *addr;
intc_disable(data);
@@ -91,7 +91,7 @@ static void intc_mask_ack(struct irq_data *data)
if (handle) {
unsigned int value;
- addr = INTC_REG(d, _INTC_ADDR_D(handle), 0);
+ addr = (void __iomem *)INTC_REG(d, _INTC_ADDR_D(handle), 0);
value = intc_set_field_from_handle(0, 1, handle);
switch (_INTC_FN(handle)) {
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 9be296cf7295..6ee59001d61d 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -530,7 +530,8 @@ static inline int sci_rxd_in(struct uart_port *port)
if (s->cfg->port_reg <= 0)
return 1;
- return !!__raw_readb(s->cfg->port_reg);
+ /* Cast for ARM damage */
+ return !!__raw_readb((void __iomem *)s->cfg->port_reg);
}
/* ********************************************************************** *