diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/sh/intc/access.c | 45 | ||||
-rw-r--r-- | drivers/sh/intc/chip.c | 4 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 3 |
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 | |||
75 | static unsigned long test_8(unsigned long addr, unsigned long h, | 75 | static unsigned long test_8(unsigned long addr, unsigned long h, |
76 | unsigned long ignore) | 76 | unsigned long ignore) |
77 | { | 77 | { |
78 | return intc_get_field_from_handle(__raw_readb(addr), h); | 78 | void __iomem *ptr = (void __iomem *)addr; |
79 | return intc_get_field_from_handle(__raw_readb(ptr), h); | ||
79 | } | 80 | } |
80 | 81 | ||
81 | static unsigned long test_16(unsigned long addr, unsigned long h, | 82 | static unsigned long test_16(unsigned long addr, unsigned long h, |
82 | unsigned long ignore) | 83 | unsigned long ignore) |
83 | { | 84 | { |
84 | return intc_get_field_from_handle(__raw_readw(addr), h); | 85 | void __iomem *ptr = (void __iomem *)addr; |
86 | return intc_get_field_from_handle(__raw_readw(ptr), h); | ||
85 | } | 87 | } |
86 | 88 | ||
87 | static unsigned long test_32(unsigned long addr, unsigned long h, | 89 | static unsigned long test_32(unsigned long addr, unsigned long h, |
88 | unsigned long ignore) | 90 | unsigned long ignore) |
89 | { | 91 | { |
90 | return intc_get_field_from_handle(__raw_readl(addr), h); | 92 | void __iomem *ptr = (void __iomem *)addr; |
93 | return intc_get_field_from_handle(__raw_readl(ptr), h); | ||
91 | } | 94 | } |
92 | 95 | ||
93 | static unsigned long write_8(unsigned long addr, unsigned long h, | 96 | static unsigned long write_8(unsigned long addr, unsigned long h, |
94 | unsigned long data) | 97 | unsigned long data) |
95 | { | 98 | { |
96 | __raw_writeb(intc_set_field_from_handle(0, data, h), addr); | 99 | void __iomem *ptr = (void __iomem *)addr; |
97 | (void)__raw_readb(addr); /* Defeat write posting */ | 100 | __raw_writeb(intc_set_field_from_handle(0, data, h), ptr); |
101 | (void)__raw_readb(ptr); /* Defeat write posting */ | ||
98 | return 0; | 102 | return 0; |
99 | } | 103 | } |
100 | 104 | ||
101 | static unsigned long write_16(unsigned long addr, unsigned long h, | 105 | static unsigned long write_16(unsigned long addr, unsigned long h, |
102 | unsigned long data) | 106 | unsigned long data) |
103 | { | 107 | { |
104 | __raw_writew(intc_set_field_from_handle(0, data, h), addr); | 108 | void __iomem *ptr = (void __iomem *)addr; |
105 | (void)__raw_readw(addr); /* Defeat write posting */ | 109 | __raw_writew(intc_set_field_from_handle(0, data, h), ptr); |
110 | (void)__raw_readw(ptr); /* Defeat write posting */ | ||
106 | return 0; | 111 | return 0; |
107 | } | 112 | } |
108 | 113 | ||
109 | static unsigned long write_32(unsigned long addr, unsigned long h, | 114 | static unsigned long write_32(unsigned long addr, unsigned long h, |
110 | unsigned long data) | 115 | unsigned long data) |
111 | { | 116 | { |
112 | __raw_writel(intc_set_field_from_handle(0, data, h), addr); | 117 | void __iomem *ptr = (void __iomem *)addr; |
113 | (void)__raw_readl(addr); /* Defeat write posting */ | 118 | __raw_writel(intc_set_field_from_handle(0, data, h), ptr); |
119 | (void)__raw_readl(ptr); /* Defeat write posting */ | ||
114 | return 0; | 120 | return 0; |
115 | } | 121 | } |
116 | 122 | ||
117 | static unsigned long modify_8(unsigned long addr, unsigned long h, | 123 | static unsigned long modify_8(unsigned long addr, unsigned long h, |
118 | unsigned long data) | 124 | unsigned long data) |
119 | { | 125 | { |
126 | void __iomem *ptr = (void __iomem *)addr; | ||
120 | unsigned long flags; | 127 | unsigned long flags; |
121 | unsigned int value; | 128 | unsigned int value; |
122 | local_irq_save(flags); | 129 | local_irq_save(flags); |
123 | value = intc_set_field_from_handle(__raw_readb(addr), data, h); | 130 | value = intc_set_field_from_handle(__raw_readb(ptr), data, h); |
124 | __raw_writeb(value, addr); | 131 | __raw_writeb(value, ptr); |
125 | (void)__raw_readb(addr); /* Defeat write posting */ | 132 | (void)__raw_readb(ptr); /* Defeat write posting */ |
126 | local_irq_restore(flags); | 133 | local_irq_restore(flags); |
127 | return 0; | 134 | return 0; |
128 | } | 135 | } |
@@ -130,12 +137,13 @@ static unsigned long modify_8(unsigned long addr, unsigned long h, | |||
130 | static unsigned long modify_16(unsigned long addr, unsigned long h, | 137 | static unsigned long modify_16(unsigned long addr, unsigned long h, |
131 | unsigned long data) | 138 | unsigned long data) |
132 | { | 139 | { |
140 | void __iomem *ptr = (void __iomem *)addr; | ||
133 | unsigned long flags; | 141 | unsigned long flags; |
134 | unsigned int value; | 142 | unsigned int value; |
135 | local_irq_save(flags); | 143 | local_irq_save(flags); |
136 | value = intc_set_field_from_handle(__raw_readw(addr), data, h); | 144 | value = intc_set_field_from_handle(__raw_readw(ptr), data, h); |
137 | __raw_writew(value, addr); | 145 | __raw_writew(value, ptr); |
138 | (void)__raw_readw(addr); /* Defeat write posting */ | 146 | (void)__raw_readw(ptr); /* Defeat write posting */ |
139 | local_irq_restore(flags); | 147 | local_irq_restore(flags); |
140 | return 0; | 148 | return 0; |
141 | } | 149 | } |
@@ -143,12 +151,13 @@ static unsigned long modify_16(unsigned long addr, unsigned long h, | |||
143 | static unsigned long modify_32(unsigned long addr, unsigned long h, | 151 | static unsigned long modify_32(unsigned long addr, unsigned long h, |
144 | unsigned long data) | 152 | unsigned long data) |
145 | { | 153 | { |
154 | void __iomem *ptr = (void __iomem *)addr; | ||
146 | unsigned long flags; | 155 | unsigned long flags; |
147 | unsigned int value; | 156 | unsigned int value; |
148 | local_irq_save(flags); | 157 | local_irq_save(flags); |
149 | value = intc_set_field_from_handle(__raw_readl(addr), data, h); | 158 | value = intc_set_field_from_handle(__raw_readl(ptr), data, h); |
150 | __raw_writel(value, addr); | 159 | __raw_writel(value, ptr); |
151 | (void)__raw_readl(addr); /* Defeat write posting */ | 160 | (void)__raw_readl(ptr); /* Defeat write posting */ |
152 | local_irq_restore(flags); | 161 | local_irq_restore(flags); |
153 | return 0; | 162 | return 0; |
154 | } | 163 | } |
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) | |||
83 | unsigned int irq = data->irq; | 83 | unsigned int irq = data->irq; |
84 | struct intc_desc_int *d = get_intc_desc(irq); | 84 | struct intc_desc_int *d = get_intc_desc(irq); |
85 | unsigned long handle = intc_get_ack_handle(irq); | 85 | unsigned long handle = intc_get_ack_handle(irq); |
86 | unsigned long addr; | 86 | void __iomem *addr; |
87 | 87 | ||
88 | intc_disable(data); | 88 | intc_disable(data); |
89 | 89 | ||
@@ -91,7 +91,7 @@ static void intc_mask_ack(struct irq_data *data) | |||
91 | if (handle) { | 91 | if (handle) { |
92 | unsigned int value; | 92 | unsigned int value; |
93 | 93 | ||
94 | addr = INTC_REG(d, _INTC_ADDR_D(handle), 0); | 94 | addr = (void __iomem *)INTC_REG(d, _INTC_ADDR_D(handle), 0); |
95 | value = intc_set_field_from_handle(0, 1, handle); | 95 | value = intc_set_field_from_handle(0, 1, handle); |
96 | 96 | ||
97 | switch (_INTC_FN(handle)) { | 97 | 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) | |||
530 | if (s->cfg->port_reg <= 0) | 530 | if (s->cfg->port_reg <= 0) |
531 | return 1; | 531 | return 1; |
532 | 532 | ||
533 | return !!__raw_readb(s->cfg->port_reg); | 533 | /* Cast for ARM damage */ |
534 | return !!__raw_readb((void __iomem *)s->cfg->port_reg); | ||
534 | } | 535 | } |
535 | 536 | ||
536 | /* ********************************************************************** * | 537 | /* ********************************************************************** * |