Commit 0dd4d5cb authored by Paul Mundt's avatar Paul Mundt

sh: Fix up more fallout from pointless ARM __iomem churn.

It was already pointed out how to fix these cases before the offending
patches were merged, but unsurprisingly, that didn't happen. As this
change is entirely superfluous to begin with, simply shut things up by
casting everything away.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent cf759932
......@@ -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;
}
......
......@@ -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)) {
......
......@@ -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);
}
/* ********************************************************************** *
......
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