diff options
Diffstat (limited to 'drivers/sh/intc/access.c')
-rw-r--r-- | drivers/sh/intc/access.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/drivers/sh/intc/access.c b/drivers/sh/intc/access.c index f892ae1d212..114390f967d 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 | } |