aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-03-28 00:53:10 -0400
committerPaul Mundt <lethal@linux-sh.org>2012-03-28 00:53:10 -0400
commit18af30e259c25a64ad69bb749c661564bc886275 (patch)
tree996c89594fd20f25fcc15b5843625d99473f6982 /arch/sh
parent691c01c3f0b3252308162de90edcd02f7ca1733c (diff)
parent6658a6991cef75719a21441aa0b7f8d6821534ee (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into sh-latest
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c22
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c24
-rw-r--r--arch/sh/boards/mach-highlander/setup.c2
-rw-r--r--arch/sh/boards/mach-kfr2r09/lcd_wqvga.c10
-rw-r--r--arch/sh/boards/mach-kfr2r09/setup.c8
-rw-r--r--arch/sh/boards/mach-migor/lcd_qvga.c3
-rw-r--r--arch/sh/boards/mach-migor/setup.c16
-rw-r--r--arch/sh/boards/mach-sdk7786/setup.c2
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c16
-rw-r--r--arch/sh/drivers/pci/pci.c75
-rw-r--r--arch/sh/include/asm/clock.h2
-rw-r--r--arch/sh/include/asm/pci.h6
-rw-r--r--arch/sh/include/mach-kfr2r09/mach/kfr2r09.h16
-rw-r--r--arch/sh/include/mach-migor/mach/migor.h2
-rw-r--r--arch/sh/kernel/cpu/sh2/clock-sh7619.c12
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7201.c12
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7203.c12
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7206.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh3.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7705.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7706.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7709.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7710.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7712.c10
-rw-r--r--arch/sh/kernel/cpu/sh4/clock-sh4-202.c6
-rw-r--r--arch/sh/kernel/cpu/sh4/clock-sh4.c12
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7343.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7366.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7723.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c6
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7757.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7763.c14
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7770.c12
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7780.c14
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7785.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7786.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-shx3.c2
-rw-r--r--arch/sh/kernel/cpu/sh5/clock-sh5.c12
-rw-r--r--arch/sh/kernel/idle.c4
-rw-r--r--arch/sh/kernel/perf_event.c4
-rw-r--r--arch/sh/kernel/vsyscall/vsyscall.c3
-rw-r--r--arch/sh/mm/cache-sh4.c4
-rw-r--r--arch/sh/mm/cache.c12
44 files changed, 191 insertions, 258 deletions
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index ebd0f818a25f..8cf02e343333 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -157,7 +157,7 @@ static struct platform_device nand_flash_device = {
157#define PORT_DRVCRA 0xA405018A 157#define PORT_DRVCRA 0xA405018A
158#define PORT_DRVCRB 0xA405018C 158#define PORT_DRVCRB 0xA405018C
159 159
160static int ap320_wvga_set_brightness(void *board_data, int brightness) 160static int ap320_wvga_set_brightness(int brightness)
161{ 161{
162 if (brightness) { 162 if (brightness) {
163 gpio_set_value(GPIO_PTS3, 0); 163 gpio_set_value(GPIO_PTS3, 0);
@@ -170,12 +170,12 @@ static int ap320_wvga_set_brightness(void *board_data, int brightness)
170 return 0; 170 return 0;
171} 171}
172 172
173static int ap320_wvga_get_brightness(void *board_data) 173static int ap320_wvga_get_brightness(void)
174{ 174{
175 return gpio_get_value(GPIO_PTS3); 175 return gpio_get_value(GPIO_PTS3);
176} 176}
177 177
178static void ap320_wvga_power_on(void *board_data, struct fb_info *info) 178static void ap320_wvga_power_on(void)
179{ 179{
180 msleep(100); 180 msleep(100);
181 181
@@ -183,7 +183,7 @@ static void ap320_wvga_power_on(void *board_data, struct fb_info *info)
183 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG); 183 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
184} 184}
185 185
186static void ap320_wvga_power_off(void *board_data) 186static void ap320_wvga_power_off(void)
187{ 187{
188 /* ASD AP-320/325 LCD OFF */ 188 /* ASD AP-320/325 LCD OFF */
189 __raw_writew(0, FPGA_LCDREG); 189 __raw_writew(0, FPGA_LCDREG);
@@ -211,21 +211,19 @@ static struct sh_mobile_lcdc_info lcdc_info = {
211 .fourcc = V4L2_PIX_FMT_RGB565, 211 .fourcc = V4L2_PIX_FMT_RGB565,
212 .interface_type = RGB18, 212 .interface_type = RGB18,
213 .clock_divider = 1, 213 .clock_divider = 1,
214 .lcd_cfg = ap325rxa_lcdc_modes, 214 .lcd_modes = ap325rxa_lcdc_modes,
215 .num_cfg = ARRAY_SIZE(ap325rxa_lcdc_modes), 215 .num_modes = ARRAY_SIZE(ap325rxa_lcdc_modes),
216 .lcd_size_cfg = { /* 7.0 inch */ 216 .panel_cfg = {
217 .width = 152, 217 .width = 152, /* 7.0 inch */
218 .height = 91, 218 .height = 91,
219 },
220 .board_cfg = {
221 .display_on = ap320_wvga_power_on, 219 .display_on = ap320_wvga_power_on,
222 .display_off = ap320_wvga_power_off, 220 .display_off = ap320_wvga_power_off,
223 .set_brightness = ap320_wvga_set_brightness,
224 .get_brightness = ap320_wvga_get_brightness,
225 }, 221 },
226 .bl_info = { 222 .bl_info = {
227 .name = "sh_mobile_lcdc_bl", 223 .name = "sh_mobile_lcdc_bl",
228 .max_brightness = 1, 224 .max_brightness = 1,
225 .set_brightness = ap320_wvga_set_brightness,
226 .get_brightness = ap320_wvga_get_brightness,
229 }, 227 },
230 } 228 }
231}; 229};
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index cde7c0085ced..e5ac12b2ce65 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -310,14 +310,14 @@ static const struct fb_videomode ecovec_dvi_modes[] = {
310 }, 310 },
311}; 311};
312 312
313static int ecovec24_set_brightness(void *board_data, int brightness) 313static int ecovec24_set_brightness(int brightness)
314{ 314{
315 gpio_set_value(GPIO_PTR1, brightness); 315 gpio_set_value(GPIO_PTR1, brightness);
316 316
317 return 0; 317 return 0;
318} 318}
319 319
320static int ecovec24_get_brightness(void *board_data) 320static int ecovec24_get_brightness(void)
321{ 321{
322 return gpio_get_value(GPIO_PTR1); 322 return gpio_get_value(GPIO_PTR1);
323} 323}
@@ -327,17 +327,15 @@ static struct sh_mobile_lcdc_info lcdc_info = {
327 .interface_type = RGB18, 327 .interface_type = RGB18,
328 .chan = LCDC_CHAN_MAINLCD, 328 .chan = LCDC_CHAN_MAINLCD,
329 .fourcc = V4L2_PIX_FMT_RGB565, 329 .fourcc = V4L2_PIX_FMT_RGB565,
330 .lcd_size_cfg = { /* 7.0 inch */ 330 .panel_cfg = { /* 7.0 inch */
331 .width = 152, 331 .width = 152,
332 .height = 91, 332 .height = 91,
333 }, 333 },
334 .board_cfg = {
335 .set_brightness = ecovec24_set_brightness,
336 .get_brightness = ecovec24_get_brightness,
337 },
338 .bl_info = { 334 .bl_info = {
339 .name = "sh_mobile_lcdc_bl", 335 .name = "sh_mobile_lcdc_bl",
340 .max_brightness = 1, 336 .max_brightness = 1,
337 .set_brightness = ecovec24_set_brightness,
338 .get_brightness = ecovec24_get_brightness,
341 }, 339 },
342 } 340 }
343}; 341};
@@ -769,7 +767,9 @@ static struct platform_device camera_devices[] = {
769 767
770/* FSI */ 768/* FSI */
771static struct sh_fsi_platform_info fsi_info = { 769static struct sh_fsi_platform_info fsi_info = {
772 .portb_flags = SH_FSI_BRS_INV, 770 .port_b = {
771 .flags = SH_FSI_BRS_INV,
772 },
773}; 773};
774 774
775static struct resource fsi_resources[] = { 775static struct resource fsi_resources[] = {
@@ -1116,8 +1116,8 @@ static int __init arch_setup(void)
1116 /* DVI */ 1116 /* DVI */
1117 lcdc_info.clock_source = LCDC_CLK_EXTERNAL; 1117 lcdc_info.clock_source = LCDC_CLK_EXTERNAL;
1118 lcdc_info.ch[0].clock_divider = 1; 1118 lcdc_info.ch[0].clock_divider = 1;
1119 lcdc_info.ch[0].lcd_cfg = ecovec_dvi_modes; 1119 lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes;
1120 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_dvi_modes); 1120 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes);
1121 1121
1122 gpio_set_value(GPIO_PTA2, 1); 1122 gpio_set_value(GPIO_PTA2, 1);
1123 gpio_set_value(GPIO_PTU1, 1); 1123 gpio_set_value(GPIO_PTU1, 1);
@@ -1125,8 +1125,8 @@ static int __init arch_setup(void)
1125 /* Panel */ 1125 /* Panel */
1126 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL; 1126 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL;
1127 lcdc_info.ch[0].clock_divider = 2; 1127 lcdc_info.ch[0].clock_divider = 2;
1128 lcdc_info.ch[0].lcd_cfg = ecovec_lcd_modes; 1128 lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes;
1129 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_lcd_modes); 1129 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes);
1130 1130
1131 gpio_set_value(GPIO_PTR1, 1); 1131 gpio_set_value(GPIO_PTR1, 1);
1132 1132
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
index 74b8db1b74a9..4a52590fe3d8 100644
--- a/arch/sh/boards/mach-highlander/setup.c
+++ b/arch/sh/boards/mach-highlander/setup.c
@@ -322,7 +322,7 @@ static void ivdr_clk_disable(struct clk *clk)
322 __raw_writew(__raw_readw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL); 322 __raw_writew(__raw_readw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
323} 323}
324 324
325static struct clk_ops ivdr_clk_ops = { 325static struct sh_clk_ops ivdr_clk_ops = {
326 .enable = ivdr_clk_enable, 326 .enable = ivdr_clk_enable,
327 .disable = ivdr_clk_disable, 327 .disable = ivdr_clk_disable,
328}; 328};
diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
index 25e145fb7087..c148b36ecb65 100644
--- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
+++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
@@ -251,8 +251,7 @@ static void display_on(void *sohandle,
251 write_memory_start(sohandle, so); 251 write_memory_start(sohandle, so);
252} 252}
253 253
254int kfr2r09_lcd_setup(void *board_data, void *sohandle, 254int kfr2r09_lcd_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
255 struct sh_mobile_lcdc_sys_bus_ops *so)
256{ 255{
257 /* power on */ 256 /* power on */
258 gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */ 257 gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
@@ -273,8 +272,7 @@ int kfr2r09_lcd_setup(void *board_data, void *sohandle,
273 return 0; 272 return 0;
274} 273}
275 274
276void kfr2r09_lcd_start(void *board_data, void *sohandle, 275void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
277 struct sh_mobile_lcdc_sys_bus_ops *so)
278{ 276{
279 write_memory_start(sohandle, so); 277 write_memory_start(sohandle, so);
280} 278}
@@ -327,12 +325,12 @@ static int kfr2r09_lcd_backlight(int on)
327 return 0; 325 return 0;
328} 326}
329 327
330void kfr2r09_lcd_on(void *board_data, struct fb_info *info) 328void kfr2r09_lcd_on(void)
331{ 329{
332 kfr2r09_lcd_backlight(1); 330 kfr2r09_lcd_backlight(1);
333} 331}
334 332
335void kfr2r09_lcd_off(void *board_data) 333void kfr2r09_lcd_off(void)
336{ 334{
337 kfr2r09_lcd_backlight(0); 335 kfr2r09_lcd_backlight(0);
338} 336}
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 5b382e1afaea..d04a55d3b877 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -148,13 +148,11 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
148 .interface_type = SYS18, 148 .interface_type = SYS18,
149 .clock_divider = 6, 149 .clock_divider = 6,
150 .flags = LCDC_FLAGS_DWPOL, 150 .flags = LCDC_FLAGS_DWPOL,
151 .lcd_cfg = kfr2r09_lcdc_modes, 151 .lcd_modes = kfr2r09_lcdc_modes,
152 .num_cfg = ARRAY_SIZE(kfr2r09_lcdc_modes), 152 .num_modes = ARRAY_SIZE(kfr2r09_lcdc_modes),
153 .lcd_size_cfg = { 153 .panel_cfg = {
154 .width = 35, 154 .width = 35,
155 .height = 58, 155 .height = 58,
156 },
157 .board_cfg = {
158 .setup_sys = kfr2r09_lcd_setup, 156 .setup_sys = kfr2r09_lcd_setup,
159 .start_transfer = kfr2r09_lcd_start, 157 .start_transfer = kfr2r09_lcd_start,
160 .display_on = kfr2r09_lcd_on, 158 .display_on = kfr2r09_lcd_on,
diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c
index de9014a8a93e..8bccd345b69c 100644
--- a/arch/sh/boards/mach-migor/lcd_qvga.c
+++ b/arch/sh/boards/mach-migor/lcd_qvga.c
@@ -113,8 +113,7 @@ static const unsigned short magic3_data[] = {
113 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061, 113 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
114}; 114};
115 115
116int migor_lcd_qvga_setup(void *board_data, void *sohandle, 116int migor_lcd_qvga_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
117 struct sh_mobile_lcdc_sys_bus_ops *so)
118{ 117{
119 unsigned long xres = 320; 118 unsigned long xres = 320;
120 unsigned long yres = 240; 119 unsigned long yres = 240;
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index d37ba2720527..ff6f69c6906e 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -246,9 +246,9 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
246 .fourcc = V4L2_PIX_FMT_RGB565, 246 .fourcc = V4L2_PIX_FMT_RGB565,
247 .interface_type = RGB16, 247 .interface_type = RGB16,
248 .clock_divider = 2, 248 .clock_divider = 2,
249 .lcd_cfg = migor_lcd_modes, 249 .lcd_modes = migor_lcd_modes,
250 .num_cfg = ARRAY_SIZE(migor_lcd_modes), 250 .num_modes = ARRAY_SIZE(migor_lcd_modes),
251 .lcd_size_cfg = { /* 7.0 inch */ 251 .panel_cfg = { /* 7.0 inch */
252 .width = 152, 252 .width = 152,
253 .height = 91, 253 .height = 91,
254 }, 254 },
@@ -260,13 +260,11 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
260 .fourcc = V4L2_PIX_FMT_RGB565, 260 .fourcc = V4L2_PIX_FMT_RGB565,
261 .interface_type = SYS16A, 261 .interface_type = SYS16A,
262 .clock_divider = 10, 262 .clock_divider = 10,
263 .lcd_cfg = migor_lcd_modes, 263 .lcd_modes = migor_lcd_modes,
264 .num_cfg = ARRAY_SIZE(migor_lcd_modes), 264 .num_modes = ARRAY_SIZE(migor_lcd_modes),
265 .lcd_size_cfg = { /* 2.4 inch */ 265 .panel_cfg = {
266 .width = 49, 266 .width = 49, /* 2.4 inch */
267 .height = 37, 267 .height = 37,
268 },
269 .board_cfg = {
270 .setup_sys = migor_lcd_qvga_setup, 268 .setup_sys = migor_lcd_qvga_setup,
271 }, 269 },
272 .sys_bus_cfg = { 270 .sys_bus_cfg = {
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c
index 486d1ac3694c..27a2314f50ac 100644
--- a/arch/sh/boards/mach-sdk7786/setup.c
+++ b/arch/sh/boards/mach-sdk7786/setup.c
@@ -167,7 +167,7 @@ static void sdk7786_pcie_clk_disable(struct clk *clk)
167 fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR); 167 fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR);
168} 168}
169 169
170static struct clk_ops sdk7786_pcie_clk_ops = { 170static struct sh_clk_ops sdk7786_pcie_clk_ops = {
171 .enable = sdk7786_pcie_clk_enable, 171 .enable = sdk7786_pcie_clk_enable,
172 .disable = sdk7786_pcie_clk_disable, 172 .disable = sdk7786_pcie_clk_disable,
173}; 173};
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 2b07fc016950..c540b16547c3 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -182,12 +182,10 @@ static struct sh_mobile_lcdc_info lcdc_info = {
182 .chan = LCDC_CHAN_MAINLCD, 182 .chan = LCDC_CHAN_MAINLCD,
183 .fourcc = V4L2_PIX_FMT_RGB565, 183 .fourcc = V4L2_PIX_FMT_RGB565,
184 .clock_divider = 1, 184 .clock_divider = 1,
185 .lcd_size_cfg = { /* 7.0 inch */ 185 .panel_cfg = { /* 7.0 inch */
186 .width = 152, 186 .width = 152,
187 .height = 91, 187 .height = 91,
188 }, 188 },
189 .board_cfg = {
190 },
191 } 189 }
192}; 190};
193 191
@@ -278,7 +276,9 @@ static struct platform_device ceu1_device = {
278/* FSI */ 276/* FSI */
279/* change J20, J21, J22 pin to 1-2 connection to use slave mode */ 277/* change J20, J21, J22 pin to 1-2 connection to use slave mode */
280static struct sh_fsi_platform_info fsi_info = { 278static struct sh_fsi_platform_info fsi_info = {
281 .porta_flags = SH_FSI_BRS_INV, 279 .port_a = {
280 .flags = SH_FSI_BRS_INV,
281 },
282}; 282};
283 283
284static struct resource fsi_resources[] = { 284static struct resource fsi_resources[] = {
@@ -888,12 +888,12 @@ static int __init devices_setup(void)
888 888
889 if (sw & SW41_B) { 889 if (sw & SW41_B) {
890 /* 720p */ 890 /* 720p */
891 lcdc_info.ch[0].lcd_cfg = lcdc_720p_modes; 891 lcdc_info.ch[0].lcd_modes = lcdc_720p_modes;
892 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_720p_modes); 892 lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_720p_modes);
893 } else { 893 } else {
894 /* VGA */ 894 /* VGA */
895 lcdc_info.ch[0].lcd_cfg = lcdc_vga_modes; 895 lcdc_info.ch[0].lcd_modes = lcdc_vga_modes;
896 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_vga_modes); 896 lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_vga_modes);
897 } 897 }
898 898
899 if (sw & SW41_A) { 899 if (sw & SW41_A) {
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 1e7b0e2e764d..9d10a3cb8797 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -37,11 +37,20 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose)
37 static int next_busno; 37 static int next_busno;
38 static int need_domain_info; 38 static int need_domain_info;
39 LIST_HEAD(resources); 39 LIST_HEAD(resources);
40 struct resource *res;
41 resource_size_t offset;
40 int i; 42 int i;
41 struct pci_bus *bus; 43 struct pci_bus *bus;
42 44
43 for (i = 0; i < hose->nr_resources; i++) 45 for (i = 0; i < hose->nr_resources; i++) {
44 pci_add_resource(&resources, hose->resources + i); 46 res = hose->resources + i;
47 offset = 0;
48 if (res->flags & IORESOURCE_IO)
49 offset = hose->io_offset;
50 else if (res->flags & IORESOURCE_MEM)
51 offset = hose->mem_offset;
52 pci_add_resource_offset(&resources, res, offset);
53 }
45 54
46 bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose, 55 bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
47 &resources); 56 &resources);
@@ -143,42 +152,12 @@ static int __init pcibios_init(void)
143} 152}
144subsys_initcall(pcibios_init); 153subsys_initcall(pcibios_init);
145 154
146static void pcibios_fixup_device_resources(struct pci_dev *dev,
147 struct pci_bus *bus)
148{
149 /* Update device resources. */
150 struct pci_channel *hose = bus->sysdata;
151 unsigned long offset = 0;
152 int i;
153
154 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
155 if (!dev->resource[i].start)
156 continue;
157 if (dev->resource[i].flags & IORESOURCE_IO)
158 offset = hose->io_offset;
159 else if (dev->resource[i].flags & IORESOURCE_MEM)
160 offset = hose->mem_offset;
161
162 dev->resource[i].start += offset;
163 dev->resource[i].end += offset;
164 }
165}
166
167/* 155/*
168 * Called after each bus is probed, but before its children 156 * Called after each bus is probed, but before its children
169 * are examined. 157 * are examined.
170 */ 158 */
171void __devinit pcibios_fixup_bus(struct pci_bus *bus) 159void __devinit pcibios_fixup_bus(struct pci_bus *bus)
172{ 160{
173 struct pci_dev *dev;
174 struct list_head *ln;
175
176 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
177 dev = pci_dev_b(ln);
178
179 if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
180 pcibios_fixup_device_resources(dev, bus);
181 }
182} 161}
183 162
184/* 163/*
@@ -208,36 +187,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
208 return start; 187 return start;
209} 188}
210 189
211void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
212 struct resource *res)
213{
214 struct pci_channel *hose = dev->sysdata;
215 unsigned long offset = 0;
216
217 if (res->flags & IORESOURCE_IO)
218 offset = hose->io_offset;
219 else if (res->flags & IORESOURCE_MEM)
220 offset = hose->mem_offset;
221
222 region->start = res->start - offset;
223 region->end = res->end - offset;
224}
225
226void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
227 struct pci_bus_region *region)
228{
229 struct pci_channel *hose = dev->sysdata;
230 unsigned long offset = 0;
231
232 if (res->flags & IORESOURCE_IO)
233 offset = hose->io_offset;
234 else if (res->flags & IORESOURCE_MEM)
235 offset = hose->mem_offset;
236
237 res->start = region->start + offset;
238 res->end = region->end + offset;
239}
240
241int pcibios_enable_device(struct pci_dev *dev, int mask) 190int pcibios_enable_device(struct pci_dev *dev, int mask)
242{ 191{
243 return pci_enable_resources(dev, mask); 192 return pci_enable_resources(dev, mask);
@@ -381,8 +330,6 @@ EXPORT_SYMBOL(pci_iounmap);
381#endif /* CONFIG_GENERIC_IOMAP */ 330#endif /* CONFIG_GENERIC_IOMAP */
382 331
383#ifdef CONFIG_HOTPLUG 332#ifdef CONFIG_HOTPLUG
384EXPORT_SYMBOL(pcibios_resource_to_bus);
385EXPORT_SYMBOL(pcibios_bus_to_resource);
386EXPORT_SYMBOL(PCIBIOS_MIN_IO); 333EXPORT_SYMBOL(PCIBIOS_MIN_IO);
387EXPORT_SYMBOL(PCIBIOS_MIN_MEM); 334EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
388#endif 335#endif
diff --git a/arch/sh/include/asm/clock.h b/arch/sh/include/asm/clock.h
index 803d4c7f09dc..0390a07e7e3b 100644
--- a/arch/sh/include/asm/clock.h
+++ b/arch/sh/include/asm/clock.h
@@ -4,7 +4,7 @@
4#include <linux/sh_clk.h> 4#include <linux/sh_clk.h>
5 5
6/* Should be defined by processor-specific code */ 6/* Should be defined by processor-specific code */
7void __deprecated arch_init_clk_ops(struct clk_ops **, int type); 7void __deprecated arch_init_clk_ops(struct sh_clk_ops **, int type);
8int __init arch_clk_init(void); 8int __init arch_clk_init(void);
9 9
10/* arch/sh/kernel/cpu/clock-cpg.c */ 10/* arch/sh/kernel/cpu/clock-cpg.c */
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index cb21e2399dc1..bff96c2e7d25 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -114,12 +114,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
114/* Board-specific fixup routines. */ 114/* Board-specific fixup routines. */
115int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin); 115int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin);
116 116
117extern void pcibios_resource_to_bus(struct pci_dev *dev,
118 struct pci_bus_region *region, struct resource *res);
119
120extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
121 struct pci_bus_region *region);
122
123#define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index 117#define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index
124 118
125static inline int pci_proc_domain(struct pci_bus *bus) 119static inline int pci_proc_domain(struct pci_bus *bus)
diff --git a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
index 07e635b0e04c..ba3d93d333f8 100644
--- a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
+++ b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
@@ -4,21 +4,21 @@
4#include <video/sh_mobile_lcdc.h> 4#include <video/sh_mobile_lcdc.h>
5 5
6#if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE) 6#if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE)
7void kfr2r09_lcd_on(void *board_data, struct fb_info *info); 7void kfr2r09_lcd_on(void);
8void kfr2r09_lcd_off(void *board_data); 8void kfr2r09_lcd_off(void);
9int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle, 9int kfr2r09_lcd_setup(void *sys_ops_handle,
10 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 10 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
11void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle, 11void kfr2r09_lcd_start(void *sys_ops_handle,
12 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 12 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
13#else 13#else
14static void kfr2r09_lcd_on(void *board_data) {} 14static void kfr2r09_lcd_on(void) {}
15static void kfr2r09_lcd_off(void *board_data) {} 15static void kfr2r09_lcd_off(void) {}
16static int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle, 16static int kfr2r09_lcd_setup(void *sys_ops_handle,
17 struct sh_mobile_lcdc_sys_bus_ops *sys_ops) 17 struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
18{ 18{
19 return -ENODEV; 19 return -ENODEV;
20} 20}
21static void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle, 21static void kfr2r09_lcd_start(void *sys_ops_handle,
22 struct sh_mobile_lcdc_sys_bus_ops *sys_ops) 22 struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
23{ 23{
24} 24}
diff --git a/arch/sh/include/mach-migor/mach/migor.h b/arch/sh/include/mach-migor/mach/migor.h
index 42fccf93412e..7de7bb74c290 100644
--- a/arch/sh/include/mach-migor/mach/migor.h
+++ b/arch/sh/include/mach-migor/mach/migor.h
@@ -9,7 +9,7 @@
9 9
10#include <video/sh_mobile_lcdc.h> 10#include <video/sh_mobile_lcdc.h>
11 11
12int migor_lcd_qvga_setup(void *board_data, void *sys_ops_handle, 12int migor_lcd_qvga_setup(void *sys_ops_handle,
13 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 13 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
14 14
15#endif /* __ASM_SH_MIGOR_H */ 15#endif /* __ASM_SH_MIGOR_H */
diff --git a/arch/sh/kernel/cpu/sh2/clock-sh7619.c b/arch/sh/kernel/cpu/sh2/clock-sh7619.c
index 5b7f12e58a8d..e80252ae5bca 100644
--- a/arch/sh/kernel/cpu/sh2/clock-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/clock-sh7619.c
@@ -28,7 +28,7 @@ static void master_clk_init(struct clk *clk)
28 clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 7]; 28 clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 7];
29} 29}
30 30
31static struct clk_ops sh7619_master_clk_ops = { 31static struct sh_clk_ops sh7619_master_clk_ops = {
32 .init = master_clk_init, 32 .init = master_clk_init,
33}; 33};
34 34
@@ -38,7 +38,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
38 return clk->parent->rate / pfc_divisors[idx]; 38 return clk->parent->rate / pfc_divisors[idx];
39} 39}
40 40
41static struct clk_ops sh7619_module_clk_ops = { 41static struct sh_clk_ops sh7619_module_clk_ops = {
42 .recalc = module_clk_recalc, 42 .recalc = module_clk_recalc,
43}; 43};
44 44
@@ -47,22 +47,22 @@ static unsigned long bus_clk_recalc(struct clk *clk)
47 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 7]; 47 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 7];
48} 48}
49 49
50static struct clk_ops sh7619_bus_clk_ops = { 50static struct sh_clk_ops sh7619_bus_clk_ops = {
51 .recalc = bus_clk_recalc, 51 .recalc = bus_clk_recalc,
52}; 52};
53 53
54static struct clk_ops sh7619_cpu_clk_ops = { 54static struct sh_clk_ops sh7619_cpu_clk_ops = {
55 .recalc = followparent_recalc, 55 .recalc = followparent_recalc,
56}; 56};
57 57
58static struct clk_ops *sh7619_clk_ops[] = { 58static struct sh_clk_ops *sh7619_clk_ops[] = {
59 &sh7619_master_clk_ops, 59 &sh7619_master_clk_ops,
60 &sh7619_module_clk_ops, 60 &sh7619_module_clk_ops,
61 &sh7619_bus_clk_ops, 61 &sh7619_bus_clk_ops,
62 &sh7619_cpu_clk_ops, 62 &sh7619_cpu_clk_ops,
63}; 63};
64 64
65void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 65void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
66{ 66{
67 if (test_mode_pin(MODE_PIN2 | MODE_PIN0) || 67 if (test_mode_pin(MODE_PIN2 | MODE_PIN0) ||
68 test_mode_pin(MODE_PIN2 | MODE_PIN1)) 68 test_mode_pin(MODE_PIN2 | MODE_PIN1))
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
index 1174e2d96c03..532a36c72322 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
@@ -30,7 +30,7 @@ static void master_clk_init(struct clk *clk)
30 pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007]; 30 pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
31} 31}
32 32
33static struct clk_ops sh7201_master_clk_ops = { 33static struct sh_clk_ops sh7201_master_clk_ops = {
34 .init = master_clk_init, 34 .init = master_clk_init,
35}; 35};
36 36
@@ -40,7 +40,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
40 return clk->parent->rate / pfc_divisors[idx]; 40 return clk->parent->rate / pfc_divisors[idx];
41} 41}
42 42
43static struct clk_ops sh7201_module_clk_ops = { 43static struct sh_clk_ops sh7201_module_clk_ops = {
44 .recalc = module_clk_recalc, 44 .recalc = module_clk_recalc,
45}; 45};
46 46
@@ -50,7 +50,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
50 return clk->parent->rate / pfc_divisors[idx]; 50 return clk->parent->rate / pfc_divisors[idx];
51} 51}
52 52
53static struct clk_ops sh7201_bus_clk_ops = { 53static struct sh_clk_ops sh7201_bus_clk_ops = {
54 .recalc = bus_clk_recalc, 54 .recalc = bus_clk_recalc,
55}; 55};
56 56
@@ -60,18 +60,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
60 return clk->parent->rate / ifc_divisors[idx]; 60 return clk->parent->rate / ifc_divisors[idx];
61} 61}
62 62
63static struct clk_ops sh7201_cpu_clk_ops = { 63static struct sh_clk_ops sh7201_cpu_clk_ops = {
64 .recalc = cpu_clk_recalc, 64 .recalc = cpu_clk_recalc,
65}; 65};
66 66
67static struct clk_ops *sh7201_clk_ops[] = { 67static struct sh_clk_ops *sh7201_clk_ops[] = {
68 &sh7201_master_clk_ops, 68 &sh7201_master_clk_ops,
69 &sh7201_module_clk_ops, 69 &sh7201_module_clk_ops,
70 &sh7201_bus_clk_ops, 70 &sh7201_bus_clk_ops,
71 &sh7201_cpu_clk_ops, 71 &sh7201_cpu_clk_ops,
72}; 72};
73 73
74void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 74void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
75{ 75{
76 if (test_mode_pin(MODE_PIN1 | MODE_PIN0)) 76 if (test_mode_pin(MODE_PIN1 | MODE_PIN0))
77 pll2_mult = 1; 77 pll2_mult = 1;
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7203.c b/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
index 95a008e8b735..529f719b6e33 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
@@ -32,7 +32,7 @@ static void master_clk_init(struct clk *clk)
32 clk->rate *= pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0003] * pll2_mult; 32 clk->rate *= pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0003] * pll2_mult;
33} 33}
34 34
35static struct clk_ops sh7203_master_clk_ops = { 35static struct sh_clk_ops sh7203_master_clk_ops = {
36 .init = master_clk_init, 36 .init = master_clk_init,
37}; 37};
38 38
@@ -42,7 +42,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
42 return clk->parent->rate / pfc_divisors[idx]; 42 return clk->parent->rate / pfc_divisors[idx];
43} 43}
44 44
45static struct clk_ops sh7203_module_clk_ops = { 45static struct sh_clk_ops sh7203_module_clk_ops = {
46 .recalc = module_clk_recalc, 46 .recalc = module_clk_recalc,
47}; 47};
48 48
@@ -52,22 +52,22 @@ static unsigned long bus_clk_recalc(struct clk *clk)
52 return clk->parent->rate / pfc_divisors[idx-2]; 52 return clk->parent->rate / pfc_divisors[idx-2];
53} 53}
54 54
55static struct clk_ops sh7203_bus_clk_ops = { 55static struct sh_clk_ops sh7203_bus_clk_ops = {
56 .recalc = bus_clk_recalc, 56 .recalc = bus_clk_recalc,
57}; 57};
58 58
59static struct clk_ops sh7203_cpu_clk_ops = { 59static struct sh_clk_ops sh7203_cpu_clk_ops = {
60 .recalc = followparent_recalc, 60 .recalc = followparent_recalc,
61}; 61};
62 62
63static struct clk_ops *sh7203_clk_ops[] = { 63static struct sh_clk_ops *sh7203_clk_ops[] = {
64 &sh7203_master_clk_ops, 64 &sh7203_master_clk_ops,
65 &sh7203_module_clk_ops, 65 &sh7203_module_clk_ops,
66 &sh7203_bus_clk_ops, 66 &sh7203_bus_clk_ops,
67 &sh7203_cpu_clk_ops, 67 &sh7203_cpu_clk_ops,
68}; 68};
69 69
70void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 70void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
71{ 71{
72 if (test_mode_pin(MODE_PIN1)) 72 if (test_mode_pin(MODE_PIN1))
73 pll2_mult = 4; 73 pll2_mult = 4;
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7206.c b/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
index 3c314d7cd6e6..177789834678 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
@@ -29,7 +29,7 @@ static void master_clk_init(struct clk *clk)
29 clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007]; 29 clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
30} 30}
31 31
32static struct clk_ops sh7206_master_clk_ops = { 32static struct sh_clk_ops sh7206_master_clk_ops = {
33 .init = master_clk_init, 33 .init = master_clk_init,
34}; 34};
35 35
@@ -39,7 +39,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
39 return clk->parent->rate / pfc_divisors[idx]; 39 return clk->parent->rate / pfc_divisors[idx];
40} 40}
41 41
42static struct clk_ops sh7206_module_clk_ops = { 42static struct sh_clk_ops sh7206_module_clk_ops = {
43 .recalc = module_clk_recalc, 43 .recalc = module_clk_recalc,
44}; 44};
45 45
@@ -48,7 +48,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
48 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007]; 48 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
49} 49}
50 50
51static struct clk_ops sh7206_bus_clk_ops = { 51static struct sh_clk_ops sh7206_bus_clk_ops = {
52 .recalc = bus_clk_recalc, 52 .recalc = bus_clk_recalc,
53}; 53};
54 54
@@ -58,18 +58,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
58 return clk->parent->rate / ifc_divisors[idx]; 58 return clk->parent->rate / ifc_divisors[idx];
59} 59}
60 60
61static struct clk_ops sh7206_cpu_clk_ops = { 61static struct sh_clk_ops sh7206_cpu_clk_ops = {
62 .recalc = cpu_clk_recalc, 62 .recalc = cpu_clk_recalc,
63}; 63};
64 64
65static struct clk_ops *sh7206_clk_ops[] = { 65static struct sh_clk_ops *sh7206_clk_ops[] = {
66 &sh7206_master_clk_ops, 66 &sh7206_master_clk_ops,
67 &sh7206_module_clk_ops, 67 &sh7206_module_clk_ops,
68 &sh7206_bus_clk_ops, 68 &sh7206_bus_clk_ops,
69 &sh7206_cpu_clk_ops, 69 &sh7206_cpu_clk_ops,
70}; 70};
71 71
72void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 72void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
73{ 73{
74 if (test_mode_pin(MODE_PIN2 | MODE_PIN1 | MODE_PIN0)) 74 if (test_mode_pin(MODE_PIN2 | MODE_PIN1 | MODE_PIN0))
75 pll2_mult = 1; 75 pll2_mult = 1;
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh3.c b/arch/sh/kernel/cpu/sh3/clock-sh3.c
index b78384afac09..90faa44ca94d 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh3.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh3.c
@@ -34,7 +34,7 @@ static void master_clk_init(struct clk *clk)
34 clk->rate *= pfc_divisors[idx]; 34 clk->rate *= pfc_divisors[idx];
35} 35}
36 36
37static struct clk_ops sh3_master_clk_ops = { 37static struct sh_clk_ops sh3_master_clk_ops = {
38 .init = master_clk_init, 38 .init = master_clk_init,
39}; 39};
40 40
@@ -46,7 +46,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
46 return clk->parent->rate / pfc_divisors[idx]; 46 return clk->parent->rate / pfc_divisors[idx];
47} 47}
48 48
49static struct clk_ops sh3_module_clk_ops = { 49static struct sh_clk_ops sh3_module_clk_ops = {
50 .recalc = module_clk_recalc, 50 .recalc = module_clk_recalc,
51}; 51};
52 52
@@ -58,7 +58,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
58 return clk->parent->rate / stc_multipliers[idx]; 58 return clk->parent->rate / stc_multipliers[idx];
59} 59}
60 60
61static struct clk_ops sh3_bus_clk_ops = { 61static struct sh_clk_ops sh3_bus_clk_ops = {
62 .recalc = bus_clk_recalc, 62 .recalc = bus_clk_recalc,
63}; 63};
64 64
@@ -70,18 +70,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
70 return clk->parent->rate / ifc_divisors[idx]; 70 return clk->parent->rate / ifc_divisors[idx];
71} 71}
72 72
73static struct clk_ops sh3_cpu_clk_ops = { 73static struct sh_clk_ops sh3_cpu_clk_ops = {
74 .recalc = cpu_clk_recalc, 74 .recalc = cpu_clk_recalc,
75}; 75};
76 76
77static struct clk_ops *sh3_clk_ops[] = { 77static struct sh_clk_ops *sh3_clk_ops[] = {
78 &sh3_master_clk_ops, 78 &sh3_master_clk_ops,
79 &sh3_module_clk_ops, 79 &sh3_module_clk_ops,
80 &sh3_bus_clk_ops, 80 &sh3_bus_clk_ops,
81 &sh3_cpu_clk_ops, 81 &sh3_cpu_clk_ops,
82}; 82};
83 83
84void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 84void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
85{ 85{
86 if (idx < ARRAY_SIZE(sh3_clk_ops)) 86 if (idx < ARRAY_SIZE(sh3_clk_ops))
87 *ops = sh3_clk_ops[idx]; 87 *ops = sh3_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7705.c b/arch/sh/kernel/cpu/sh3/clock-sh7705.c
index 0ecea1451c6f..a8da4a9986b3 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7705.c
@@ -35,7 +35,7 @@ static void master_clk_init(struct clk *clk)
35 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0003]; 35 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0003];
36} 36}
37 37
38static struct clk_ops sh7705_master_clk_ops = { 38static struct sh_clk_ops sh7705_master_clk_ops = {
39 .init = master_clk_init, 39 .init = master_clk_init,
40}; 40};
41 41
@@ -45,7 +45,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
45 return clk->parent->rate / pfc_divisors[idx]; 45 return clk->parent->rate / pfc_divisors[idx];
46} 46}
47 47
48static struct clk_ops sh7705_module_clk_ops = { 48static struct sh_clk_ops sh7705_module_clk_ops = {
49 .recalc = module_clk_recalc, 49 .recalc = module_clk_recalc,
50}; 50};
51 51
@@ -55,7 +55,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
55 return clk->parent->rate / stc_multipliers[idx]; 55 return clk->parent->rate / stc_multipliers[idx];
56} 56}
57 57
58static struct clk_ops sh7705_bus_clk_ops = { 58static struct sh_clk_ops sh7705_bus_clk_ops = {
59 .recalc = bus_clk_recalc, 59 .recalc = bus_clk_recalc,
60}; 60};
61 61
@@ -65,18 +65,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
65 return clk->parent->rate / ifc_divisors[idx]; 65 return clk->parent->rate / ifc_divisors[idx];
66} 66}
67 67
68static struct clk_ops sh7705_cpu_clk_ops = { 68static struct sh_clk_ops sh7705_cpu_clk_ops = {
69 .recalc = cpu_clk_recalc, 69 .recalc = cpu_clk_recalc,
70}; 70};
71 71
72static struct clk_ops *sh7705_clk_ops[] = { 72static struct sh_clk_ops *sh7705_clk_ops[] = {
73 &sh7705_master_clk_ops, 73 &sh7705_master_clk_ops,
74 &sh7705_module_clk_ops, 74 &sh7705_module_clk_ops,
75 &sh7705_bus_clk_ops, 75 &sh7705_bus_clk_ops,
76 &sh7705_cpu_clk_ops, 76 &sh7705_cpu_clk_ops,
77}; 77};
78 78
79void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 79void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
80{ 80{
81 if (idx < ARRAY_SIZE(sh7705_clk_ops)) 81 if (idx < ARRAY_SIZE(sh7705_clk_ops))
82 *ops = sh7705_clk_ops[idx]; 82 *ops = sh7705_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7706.c b/arch/sh/kernel/cpu/sh3/clock-sh7706.c
index 6f9ff8b57dd6..a4088e5b2203 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7706.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7706.c
@@ -30,7 +30,7 @@ static void master_clk_init(struct clk *clk)
30 clk->rate *= pfc_divisors[idx]; 30 clk->rate *= pfc_divisors[idx];
31} 31}
32 32
33static struct clk_ops sh7706_master_clk_ops = { 33static struct sh_clk_ops sh7706_master_clk_ops = {
34 .init = master_clk_init, 34 .init = master_clk_init,
35}; 35};
36 36
@@ -42,7 +42,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
42 return clk->parent->rate / pfc_divisors[idx]; 42 return clk->parent->rate / pfc_divisors[idx];
43} 43}
44 44
45static struct clk_ops sh7706_module_clk_ops = { 45static struct sh_clk_ops sh7706_module_clk_ops = {
46 .recalc = module_clk_recalc, 46 .recalc = module_clk_recalc,
47}; 47};
48 48
@@ -54,7 +54,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
54 return clk->parent->rate / stc_multipliers[idx]; 54 return clk->parent->rate / stc_multipliers[idx];
55} 55}
56 56
57static struct clk_ops sh7706_bus_clk_ops = { 57static struct sh_clk_ops sh7706_bus_clk_ops = {
58 .recalc = bus_clk_recalc, 58 .recalc = bus_clk_recalc,
59}; 59};
60 60
@@ -66,18 +66,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
66 return clk->parent->rate / ifc_divisors[idx]; 66 return clk->parent->rate / ifc_divisors[idx];
67} 67}
68 68
69static struct clk_ops sh7706_cpu_clk_ops = { 69static struct sh_clk_ops sh7706_cpu_clk_ops = {
70 .recalc = cpu_clk_recalc, 70 .recalc = cpu_clk_recalc,
71}; 71};
72 72
73static struct clk_ops *sh7706_clk_ops[] = { 73static struct sh_clk_ops *sh7706_clk_ops[] = {
74 &sh7706_master_clk_ops, 74 &sh7706_master_clk_ops,
75 &sh7706_module_clk_ops, 75 &sh7706_module_clk_ops,
76 &sh7706_bus_clk_ops, 76 &sh7706_bus_clk_ops,
77 &sh7706_cpu_clk_ops, 77 &sh7706_cpu_clk_ops,
78}; 78};
79 79
80void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 80void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
81{ 81{
82 if (idx < ARRAY_SIZE(sh7706_clk_ops)) 82 if (idx < ARRAY_SIZE(sh7706_clk_ops))
83 *ops = sh7706_clk_ops[idx]; 83 *ops = sh7706_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7709.c b/arch/sh/kernel/cpu/sh3/clock-sh7709.c
index f302ba09e681..54a6d4bcc0db 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7709.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7709.c
@@ -30,7 +30,7 @@ static void master_clk_init(struct clk *clk)
30 clk->rate *= pfc_divisors[idx]; 30 clk->rate *= pfc_divisors[idx];
31} 31}
32 32
33static struct clk_ops sh7709_master_clk_ops = { 33static struct sh_clk_ops sh7709_master_clk_ops = {
34 .init = master_clk_init, 34 .init = master_clk_init,
35}; 35};
36 36
@@ -42,7 +42,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
42 return clk->parent->rate / pfc_divisors[idx]; 42 return clk->parent->rate / pfc_divisors[idx];
43} 43}
44 44
45static struct clk_ops sh7709_module_clk_ops = { 45static struct sh_clk_ops sh7709_module_clk_ops = {
46 .recalc = module_clk_recalc, 46 .recalc = module_clk_recalc,
47}; 47};
48 48
@@ -55,7 +55,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
55 return clk->parent->rate * stc_multipliers[idx]; 55 return clk->parent->rate * stc_multipliers[idx];
56} 56}
57 57
58static struct clk_ops sh7709_bus_clk_ops = { 58static struct sh_clk_ops sh7709_bus_clk_ops = {
59 .recalc = bus_clk_recalc, 59 .recalc = bus_clk_recalc,
60}; 60};
61 61
@@ -67,18 +67,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
67 return clk->parent->rate / ifc_divisors[idx]; 67 return clk->parent->rate / ifc_divisors[idx];
68} 68}
69 69
70static struct clk_ops sh7709_cpu_clk_ops = { 70static struct sh_clk_ops sh7709_cpu_clk_ops = {
71 .recalc = cpu_clk_recalc, 71 .recalc = cpu_clk_recalc,
72}; 72};
73 73
74static struct clk_ops *sh7709_clk_ops[] = { 74static struct sh_clk_ops *sh7709_clk_ops[] = {
75 &sh7709_master_clk_ops, 75 &sh7709_master_clk_ops,
76 &sh7709_module_clk_ops, 76 &sh7709_module_clk_ops,
77 &sh7709_bus_clk_ops, 77 &sh7709_bus_clk_ops,
78 &sh7709_cpu_clk_ops, 78 &sh7709_cpu_clk_ops,
79}; 79};
80 80
81void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 81void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
82{ 82{
83 if (idx < ARRAY_SIZE(sh7709_clk_ops)) 83 if (idx < ARRAY_SIZE(sh7709_clk_ops))
84 *ops = sh7709_clk_ops[idx]; 84 *ops = sh7709_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7710.c b/arch/sh/kernel/cpu/sh3/clock-sh7710.c
index 29a87d8946a4..ce601b2e3976 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7710.c
@@ -29,7 +29,7 @@ static void master_clk_init(struct clk *clk)
29 clk->rate *= md_table[__raw_readw(FRQCR) & 0x0007]; 29 clk->rate *= md_table[__raw_readw(FRQCR) & 0x0007];
30} 30}
31 31
32static struct clk_ops sh7710_master_clk_ops = { 32static struct sh_clk_ops sh7710_master_clk_ops = {
33 .init = master_clk_init, 33 .init = master_clk_init,
34}; 34};
35 35
@@ -39,7 +39,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
39 return clk->parent->rate / md_table[idx]; 39 return clk->parent->rate / md_table[idx];
40} 40}
41 41
42static struct clk_ops sh7710_module_clk_ops = { 42static struct sh_clk_ops sh7710_module_clk_ops = {
43 .recalc = module_clk_recalc, 43 .recalc = module_clk_recalc,
44}; 44};
45 45
@@ -49,7 +49,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
49 return clk->parent->rate / md_table[idx]; 49 return clk->parent->rate / md_table[idx];
50} 50}
51 51
52static struct clk_ops sh7710_bus_clk_ops = { 52static struct sh_clk_ops sh7710_bus_clk_ops = {
53 .recalc = bus_clk_recalc, 53 .recalc = bus_clk_recalc,
54}; 54};
55 55
@@ -59,18 +59,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
59 return clk->parent->rate / md_table[idx]; 59 return clk->parent->rate / md_table[idx];
60} 60}
61 61
62static struct clk_ops sh7710_cpu_clk_ops = { 62static struct sh_clk_ops sh7710_cpu_clk_ops = {
63 .recalc = cpu_clk_recalc, 63 .recalc = cpu_clk_recalc,
64}; 64};
65 65
66static struct clk_ops *sh7710_clk_ops[] = { 66static struct sh_clk_ops *sh7710_clk_ops[] = {
67 &sh7710_master_clk_ops, 67 &sh7710_master_clk_ops,
68 &sh7710_module_clk_ops, 68 &sh7710_module_clk_ops,
69 &sh7710_bus_clk_ops, 69 &sh7710_bus_clk_ops,
70 &sh7710_cpu_clk_ops, 70 &sh7710_cpu_clk_ops,
71}; 71};
72 72
73void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 73void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
74{ 74{
75 if (idx < ARRAY_SIZE(sh7710_clk_ops)) 75 if (idx < ARRAY_SIZE(sh7710_clk_ops))
76 *ops = sh7710_clk_ops[idx]; 76 *ops = sh7710_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7712.c b/arch/sh/kernel/cpu/sh3/clock-sh7712.c
index b0d0c5203996..21438a9a1ae1 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7712.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7712.c
@@ -29,7 +29,7 @@ static void master_clk_init(struct clk *clk)
29 clk->rate *= multipliers[idx]; 29 clk->rate *= multipliers[idx];
30} 30}
31 31
32static struct clk_ops sh7712_master_clk_ops = { 32static struct sh_clk_ops sh7712_master_clk_ops = {
33 .init = master_clk_init, 33 .init = master_clk_init,
34}; 34};
35 35
@@ -41,7 +41,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
41 return clk->parent->rate / divisors[idx]; 41 return clk->parent->rate / divisors[idx];
42} 42}
43 43
44static struct clk_ops sh7712_module_clk_ops = { 44static struct sh_clk_ops sh7712_module_clk_ops = {
45 .recalc = module_clk_recalc, 45 .recalc = module_clk_recalc,
46}; 46};
47 47
@@ -53,17 +53,17 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
53 return clk->parent->rate / divisors[idx]; 53 return clk->parent->rate / divisors[idx];
54} 54}
55 55
56static struct clk_ops sh7712_cpu_clk_ops = { 56static struct sh_clk_ops sh7712_cpu_clk_ops = {
57 .recalc = cpu_clk_recalc, 57 .recalc = cpu_clk_recalc,
58}; 58};
59 59
60static struct clk_ops *sh7712_clk_ops[] = { 60static struct sh_clk_ops *sh7712_clk_ops[] = {
61 &sh7712_master_clk_ops, 61 &sh7712_master_clk_ops,
62 &sh7712_module_clk_ops, 62 &sh7712_module_clk_ops,
63 &sh7712_cpu_clk_ops, 63 &sh7712_cpu_clk_ops,
64}; 64};
65 65
66void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 66void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
67{ 67{
68 if (idx < ARRAY_SIZE(sh7712_clk_ops)) 68 if (idx < ARRAY_SIZE(sh7712_clk_ops))
69 *ops = sh7712_clk_ops[idx]; 69 *ops = sh7712_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
index f4e262adb39e..4b5bab5f875f 100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
@@ -41,7 +41,7 @@ static inline int frqcr3_lookup(struct clk *clk, unsigned long rate)
41 return 5; 41 return 5;
42} 42}
43 43
44static struct clk_ops sh4202_emi_clk_ops = { 44static struct sh_clk_ops sh4202_emi_clk_ops = {
45 .recalc = emi_clk_recalc, 45 .recalc = emi_clk_recalc,
46}; 46};
47 47
@@ -56,7 +56,7 @@ static unsigned long femi_clk_recalc(struct clk *clk)
56 return clk->parent->rate / frqcr3_divisors[idx]; 56 return clk->parent->rate / frqcr3_divisors[idx];
57} 57}
58 58
59static struct clk_ops sh4202_femi_clk_ops = { 59static struct sh_clk_ops sh4202_femi_clk_ops = {
60 .recalc = femi_clk_recalc, 60 .recalc = femi_clk_recalc,
61}; 61};
62 62
@@ -130,7 +130,7 @@ static int shoc_clk_set_rate(struct clk *clk, unsigned long rate)
130 return 0; 130 return 0;
131} 131}
132 132
133static struct clk_ops sh4202_shoc_clk_ops = { 133static struct sh_clk_ops sh4202_shoc_clk_ops = {
134 .init = shoc_clk_init, 134 .init = shoc_clk_init,
135 .recalc = shoc_clk_recalc, 135 .recalc = shoc_clk_recalc,
136 .set_rate = shoc_clk_set_rate, 136 .set_rate = shoc_clk_set_rate,
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4.c b/arch/sh/kernel/cpu/sh4/clock-sh4.c
index 5add75c1f539..99e5ec8b483d 100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh4.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh4.c
@@ -31,7 +31,7 @@ static void master_clk_init(struct clk *clk)
31 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0007]; 31 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0007];
32} 32}
33 33
34static struct clk_ops sh4_master_clk_ops = { 34static struct sh_clk_ops sh4_master_clk_ops = {
35 .init = master_clk_init, 35 .init = master_clk_init,
36}; 36};
37 37
@@ -41,7 +41,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
41 return clk->parent->rate / pfc_divisors[idx]; 41 return clk->parent->rate / pfc_divisors[idx];
42} 42}
43 43
44static struct clk_ops sh4_module_clk_ops = { 44static struct sh_clk_ops sh4_module_clk_ops = {
45 .recalc = module_clk_recalc, 45 .recalc = module_clk_recalc,
46}; 46};
47 47
@@ -51,7 +51,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
51 return clk->parent->rate / bfc_divisors[idx]; 51 return clk->parent->rate / bfc_divisors[idx];
52} 52}
53 53
54static struct clk_ops sh4_bus_clk_ops = { 54static struct sh_clk_ops sh4_bus_clk_ops = {
55 .recalc = bus_clk_recalc, 55 .recalc = bus_clk_recalc,
56}; 56};
57 57
@@ -61,18 +61,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
61 return clk->parent->rate / ifc_divisors[idx]; 61 return clk->parent->rate / ifc_divisors[idx];
62} 62}
63 63
64static struct clk_ops sh4_cpu_clk_ops = { 64static struct sh_clk_ops sh4_cpu_clk_ops = {
65 .recalc = cpu_clk_recalc, 65 .recalc = cpu_clk_recalc,
66}; 66};
67 67
68static struct clk_ops *sh4_clk_ops[] = { 68static struct sh_clk_ops *sh4_clk_ops[] = {
69 &sh4_master_clk_ops, 69 &sh4_master_clk_ops,
70 &sh4_module_clk_ops, 70 &sh4_module_clk_ops,
71 &sh4_bus_clk_ops, 71 &sh4_bus_clk_ops,
72 &sh4_cpu_clk_ops, 72 &sh4_cpu_clk_ops,
73}; 73};
74 74
75void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 75void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
76{ 76{
77 if (idx < ARRAY_SIZE(sh4_clk_ops)) 77 if (idx < ARRAY_SIZE(sh4_clk_ops))
78 *ops = sh4_clk_ops[idx]; 78 *ops = sh4_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
index 70e45bdaadc7..ea01a72f1b94 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
@@ -61,7 +61,7 @@ static unsigned long dll_recalc(struct clk *clk)
61 return clk->parent->rate * mult; 61 return clk->parent->rate * mult;
62} 62}
63 63
64static struct clk_ops dll_clk_ops = { 64static struct sh_clk_ops dll_clk_ops = {
65 .recalc = dll_recalc, 65 .recalc = dll_recalc,
66}; 66};
67 67
@@ -81,7 +81,7 @@ static unsigned long pll_recalc(struct clk *clk)
81 return clk->parent->rate * mult; 81 return clk->parent->rate * mult;
82} 82}
83 83
84static struct clk_ops pll_clk_ops = { 84static struct sh_clk_ops pll_clk_ops = {
85 .recalc = pll_recalc, 85 .recalc = pll_recalc,
86}; 86};
87 87
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
index 3c3165000c52..7ac07b4f75de 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
@@ -61,7 +61,7 @@ static unsigned long dll_recalc(struct clk *clk)
61 return clk->parent->rate * mult; 61 return clk->parent->rate * mult;
62} 62}
63 63
64static struct clk_ops dll_clk_ops = { 64static struct sh_clk_ops dll_clk_ops = {
65 .recalc = dll_recalc, 65 .recalc = dll_recalc,
66}; 66};
67 67
@@ -84,7 +84,7 @@ static unsigned long pll_recalc(struct clk *clk)
84 return (clk->parent->rate * mult) / div; 84 return (clk->parent->rate * mult) / div;
85} 85}
86 86
87static struct clk_ops pll_clk_ops = { 87static struct sh_clk_ops pll_clk_ops = {
88 .recalc = pll_recalc, 88 .recalc = pll_recalc,
89}; 89};
90 90
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index 212c72ef959c..8e1f97010c0d 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -64,7 +64,7 @@ static unsigned long dll_recalc(struct clk *clk)
64 return clk->parent->rate * mult; 64 return clk->parent->rate * mult;
65} 65}
66 66
67static struct clk_ops dll_clk_ops = { 67static struct sh_clk_ops dll_clk_ops = {
68 .recalc = dll_recalc, 68 .recalc = dll_recalc,
69}; 69};
70 70
@@ -87,7 +87,7 @@ static unsigned long pll_recalc(struct clk *clk)
87 return (clk->parent->rate * mult) / div; 87 return (clk->parent->rate * mult) / div;
88} 88}
89 89
90static struct clk_ops pll_clk_ops = { 90static struct sh_clk_ops pll_clk_ops = {
91 .recalc = pll_recalc, 91 .recalc = pll_recalc,
92}; 92};
93 93
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
index 2f8c9179da47..35f75cf0c7e5 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
@@ -65,7 +65,7 @@ static unsigned long dll_recalc(struct clk *clk)
65 return clk->parent->rate * mult; 65 return clk->parent->rate * mult;
66} 66}
67 67
68static struct clk_ops dll_clk_ops = { 68static struct sh_clk_ops dll_clk_ops = {
69 .recalc = dll_recalc, 69 .recalc = dll_recalc,
70}; 70};
71 71
@@ -88,7 +88,7 @@ static unsigned long pll_recalc(struct clk *clk)
88 return (clk->parent->rate * mult) / div; 88 return (clk->parent->rate * mult) / div;
89} 89}
90 90
91static struct clk_ops pll_clk_ops = { 91static struct sh_clk_ops pll_clk_ops = {
92 .recalc = pll_recalc, 92 .recalc = pll_recalc,
93}; 93};
94 94
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 70bd96646f42..2a87901673fe 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -70,7 +70,7 @@ static unsigned long fll_recalc(struct clk *clk)
70 return (clk->parent->rate * mult) / div; 70 return (clk->parent->rate * mult) / div;
71} 71}
72 72
73static struct clk_ops fll_clk_ops = { 73static struct sh_clk_ops fll_clk_ops = {
74 .recalc = fll_recalc, 74 .recalc = fll_recalc,
75}; 75};
76 76
@@ -90,7 +90,7 @@ static unsigned long pll_recalc(struct clk *clk)
90 return clk->parent->rate * mult; 90 return clk->parent->rate * mult;
91} 91}
92 92
93static struct clk_ops pll_clk_ops = { 93static struct sh_clk_ops pll_clk_ops = {
94 .recalc = pll_recalc, 94 .recalc = pll_recalc,
95}; 95};
96 96
@@ -105,7 +105,7 @@ static unsigned long div3_recalc(struct clk *clk)
105 return clk->parent->rate / 3; 105 return clk->parent->rate / 3;
106} 106}
107 107
108static struct clk_ops div3_clk_ops = { 108static struct sh_clk_ops div3_clk_ops = {
109 .recalc = div3_recalc, 109 .recalc = div3_recalc,
110}; 110};
111 111
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index 0bd21c82151b..5853989586ed 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -33,7 +33,7 @@ static unsigned long pll_recalc(struct clk *clk)
33 return clk->parent->rate * multiplier; 33 return clk->parent->rate * multiplier;
34} 34}
35 35
36static struct clk_ops pll_clk_ops = { 36static struct sh_clk_ops pll_clk_ops = {
37 .recalc = pll_recalc, 37 .recalc = pll_recalc,
38}; 38};
39 39
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
index 2d4c7fd79c02..7707e35aea46 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
@@ -27,7 +27,7 @@ static void master_clk_init(struct clk *clk)
27 clk->rate *= p0fc_divisors[(__raw_readl(FRQCR) >> 4) & 0x07]; 27 clk->rate *= p0fc_divisors[(__raw_readl(FRQCR) >> 4) & 0x07];
28} 28}
29 29
30static struct clk_ops sh7763_master_clk_ops = { 30static struct sh_clk_ops sh7763_master_clk_ops = {
31 .init = master_clk_init, 31 .init = master_clk_init,
32}; 32};
33 33
@@ -37,7 +37,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
37 return clk->parent->rate / p0fc_divisors[idx]; 37 return clk->parent->rate / p0fc_divisors[idx];
38} 38}
39 39
40static struct clk_ops sh7763_module_clk_ops = { 40static struct sh_clk_ops sh7763_module_clk_ops = {
41 .recalc = module_clk_recalc, 41 .recalc = module_clk_recalc,
42}; 42};
43 43
@@ -47,22 +47,22 @@ static unsigned long bus_clk_recalc(struct clk *clk)
47 return clk->parent->rate / bfc_divisors[idx]; 47 return clk->parent->rate / bfc_divisors[idx];
48} 48}
49 49
50static struct clk_ops sh7763_bus_clk_ops = { 50static struct sh_clk_ops sh7763_bus_clk_ops = {
51 .recalc = bus_clk_recalc, 51 .recalc = bus_clk_recalc,
52}; 52};
53 53
54static struct clk_ops sh7763_cpu_clk_ops = { 54static struct sh_clk_ops sh7763_cpu_clk_ops = {
55 .recalc = followparent_recalc, 55 .recalc = followparent_recalc,
56}; 56};
57 57
58static struct clk_ops *sh7763_clk_ops[] = { 58static struct sh_clk_ops *sh7763_clk_ops[] = {
59 &sh7763_master_clk_ops, 59 &sh7763_master_clk_ops,
60 &sh7763_module_clk_ops, 60 &sh7763_module_clk_ops,
61 &sh7763_bus_clk_ops, 61 &sh7763_bus_clk_ops,
62 &sh7763_cpu_clk_ops, 62 &sh7763_cpu_clk_ops,
63}; 63};
64 64
65void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 65void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
66{ 66{
67 if (idx < ARRAY_SIZE(sh7763_clk_ops)) 67 if (idx < ARRAY_SIZE(sh7763_clk_ops))
68 *ops = sh7763_clk_ops[idx]; 68 *ops = sh7763_clk_ops[idx];
@@ -74,7 +74,7 @@ static unsigned long shyway_clk_recalc(struct clk *clk)
74 return clk->parent->rate / cfc_divisors[idx]; 74 return clk->parent->rate / cfc_divisors[idx];
75} 75}
76 76
77static struct clk_ops sh7763_shyway_clk_ops = { 77static struct sh_clk_ops sh7763_shyway_clk_ops = {
78 .recalc = shyway_clk_recalc, 78 .recalc = shyway_clk_recalc,
79}; 79};
80 80
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7770.c b/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
index 9e3354365d40..5d36f334bb0a 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
@@ -24,7 +24,7 @@ static void master_clk_init(struct clk *clk)
24 clk->rate *= pfc_divisors[(__raw_readl(FRQCR) >> 28) & 0x000f]; 24 clk->rate *= pfc_divisors[(__raw_readl(FRQCR) >> 28) & 0x000f];
25} 25}
26 26
27static struct clk_ops sh7770_master_clk_ops = { 27static struct sh_clk_ops sh7770_master_clk_ops = {
28 .init = master_clk_init, 28 .init = master_clk_init,
29}; 29};
30 30
@@ -34,7 +34,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
34 return clk->parent->rate / pfc_divisors[idx]; 34 return clk->parent->rate / pfc_divisors[idx];
35} 35}
36 36
37static struct clk_ops sh7770_module_clk_ops = { 37static struct sh_clk_ops sh7770_module_clk_ops = {
38 .recalc = module_clk_recalc, 38 .recalc = module_clk_recalc,
39}; 39};
40 40
@@ -44,7 +44,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
44 return clk->parent->rate / bfc_divisors[idx]; 44 return clk->parent->rate / bfc_divisors[idx];
45} 45}
46 46
47static struct clk_ops sh7770_bus_clk_ops = { 47static struct sh_clk_ops sh7770_bus_clk_ops = {
48 .recalc = bus_clk_recalc, 48 .recalc = bus_clk_recalc,
49}; 49};
50 50
@@ -54,18 +54,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
54 return clk->parent->rate / ifc_divisors[idx]; 54 return clk->parent->rate / ifc_divisors[idx];
55} 55}
56 56
57static struct clk_ops sh7770_cpu_clk_ops = { 57static struct sh_clk_ops sh7770_cpu_clk_ops = {
58 .recalc = cpu_clk_recalc, 58 .recalc = cpu_clk_recalc,
59}; 59};
60 60
61static struct clk_ops *sh7770_clk_ops[] = { 61static struct sh_clk_ops *sh7770_clk_ops[] = {
62 &sh7770_master_clk_ops, 62 &sh7770_master_clk_ops,
63 &sh7770_module_clk_ops, 63 &sh7770_module_clk_ops,
64 &sh7770_bus_clk_ops, 64 &sh7770_bus_clk_ops,
65 &sh7770_cpu_clk_ops, 65 &sh7770_cpu_clk_ops,
66}; 66};
67 67
68void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 68void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
69{ 69{
70 if (idx < ARRAY_SIZE(sh7770_clk_ops)) 70 if (idx < ARRAY_SIZE(sh7770_clk_ops))
71 *ops = sh7770_clk_ops[idx]; 71 *ops = sh7770_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
index 3b53348fe2fc..793dae42a2f8 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
@@ -27,7 +27,7 @@ static void master_clk_init(struct clk *clk)
27 clk->rate *= pfc_divisors[__raw_readl(FRQCR) & 0x0003]; 27 clk->rate *= pfc_divisors[__raw_readl(FRQCR) & 0x0003];
28} 28}
29 29
30static struct clk_ops sh7780_master_clk_ops = { 30static struct sh_clk_ops sh7780_master_clk_ops = {
31 .init = master_clk_init, 31 .init = master_clk_init,
32}; 32};
33 33
@@ -37,7 +37,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
37 return clk->parent->rate / pfc_divisors[idx]; 37 return clk->parent->rate / pfc_divisors[idx];
38} 38}
39 39
40static struct clk_ops sh7780_module_clk_ops = { 40static struct sh_clk_ops sh7780_module_clk_ops = {
41 .recalc = module_clk_recalc, 41 .recalc = module_clk_recalc,
42}; 42};
43 43
@@ -47,7 +47,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
47 return clk->parent->rate / bfc_divisors[idx]; 47 return clk->parent->rate / bfc_divisors[idx];
48} 48}
49 49
50static struct clk_ops sh7780_bus_clk_ops = { 50static struct sh_clk_ops sh7780_bus_clk_ops = {
51 .recalc = bus_clk_recalc, 51 .recalc = bus_clk_recalc,
52}; 52};
53 53
@@ -57,18 +57,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
57 return clk->parent->rate / ifc_divisors[idx]; 57 return clk->parent->rate / ifc_divisors[idx];
58} 58}
59 59
60static struct clk_ops sh7780_cpu_clk_ops = { 60static struct sh_clk_ops sh7780_cpu_clk_ops = {
61 .recalc = cpu_clk_recalc, 61 .recalc = cpu_clk_recalc,
62}; 62};
63 63
64static struct clk_ops *sh7780_clk_ops[] = { 64static struct sh_clk_ops *sh7780_clk_ops[] = {
65 &sh7780_master_clk_ops, 65 &sh7780_master_clk_ops,
66 &sh7780_module_clk_ops, 66 &sh7780_module_clk_ops,
67 &sh7780_bus_clk_ops, 67 &sh7780_bus_clk_ops,
68 &sh7780_cpu_clk_ops, 68 &sh7780_cpu_clk_ops,
69}; 69};
70 70
71void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 71void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
72{ 72{
73 if (idx < ARRAY_SIZE(sh7780_clk_ops)) 73 if (idx < ARRAY_SIZE(sh7780_clk_ops))
74 *ops = sh7780_clk_ops[idx]; 74 *ops = sh7780_clk_ops[idx];
@@ -80,7 +80,7 @@ static unsigned long shyway_clk_recalc(struct clk *clk)
80 return clk->parent->rate / cfc_divisors[idx]; 80 return clk->parent->rate / cfc_divisors[idx];
81} 81}
82 82
83static struct clk_ops sh7780_shyway_clk_ops = { 83static struct sh_clk_ops sh7780_shyway_clk_ops = {
84 .recalc = shyway_clk_recalc, 84 .recalc = shyway_clk_recalc,
85}; 85};
86 86
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index 2b314439d359..ab1c58f2d101 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -36,7 +36,7 @@ static unsigned long pll_recalc(struct clk *clk)
36 return clk->parent->rate * multiplier; 36 return clk->parent->rate * multiplier;
37} 37}
38 38
39static struct clk_ops pll_clk_ops = { 39static struct sh_clk_ops pll_clk_ops = {
40 .recalc = pll_recalc, 40 .recalc = pll_recalc,
41}; 41};
42 42
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index f6c0c3d5599f..491709483e10 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -38,7 +38,7 @@ static unsigned long pll_recalc(struct clk *clk)
38 return clk->parent->rate * multiplier; 38 return clk->parent->rate * multiplier;
39} 39}
40 40
41static struct clk_ops pll_clk_ops = { 41static struct sh_clk_ops pll_clk_ops = {
42 .recalc = pll_recalc, 42 .recalc = pll_recalc,
43}; 43};
44 44
diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
index bf2d00b8b908..0f11b392bf46 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
@@ -32,7 +32,7 @@ static unsigned long pll_recalc(struct clk *clk)
32 return clk->parent->rate * 72; 32 return clk->parent->rate * 72;
33} 33}
34 34
35static struct clk_ops pll_clk_ops = { 35static struct sh_clk_ops pll_clk_ops = {
36 .recalc = pll_recalc, 36 .recalc = pll_recalc,
37}; 37};
38 38
diff --git a/arch/sh/kernel/cpu/sh5/clock-sh5.c b/arch/sh/kernel/cpu/sh5/clock-sh5.c
index 9cfc19b8dbe4..c48b93d4c081 100644
--- a/arch/sh/kernel/cpu/sh5/clock-sh5.c
+++ b/arch/sh/kernel/cpu/sh5/clock-sh5.c
@@ -28,7 +28,7 @@ static void master_clk_init(struct clk *clk)
28 clk->rate *= ifc_table[idx]; 28 clk->rate *= ifc_table[idx];
29} 29}
30 30
31static struct clk_ops sh5_master_clk_ops = { 31static struct sh_clk_ops sh5_master_clk_ops = {
32 .init = master_clk_init, 32 .init = master_clk_init,
33}; 33};
34 34
@@ -38,7 +38,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
38 return clk->parent->rate / ifc_table[idx]; 38 return clk->parent->rate / ifc_table[idx];
39} 39}
40 40
41static struct clk_ops sh5_module_clk_ops = { 41static struct sh_clk_ops sh5_module_clk_ops = {
42 .recalc = module_clk_recalc, 42 .recalc = module_clk_recalc,
43}; 43};
44 44
@@ -48,7 +48,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
48 return clk->parent->rate / ifc_table[idx]; 48 return clk->parent->rate / ifc_table[idx];
49} 49}
50 50
51static struct clk_ops sh5_bus_clk_ops = { 51static struct sh_clk_ops sh5_bus_clk_ops = {
52 .recalc = bus_clk_recalc, 52 .recalc = bus_clk_recalc,
53}; 53};
54 54
@@ -58,18 +58,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
58 return clk->parent->rate / ifc_table[idx]; 58 return clk->parent->rate / ifc_table[idx];
59} 59}
60 60
61static struct clk_ops sh5_cpu_clk_ops = { 61static struct sh_clk_ops sh5_cpu_clk_ops = {
62 .recalc = cpu_clk_recalc, 62 .recalc = cpu_clk_recalc,
63}; 63};
64 64
65static struct clk_ops *sh5_clk_ops[] = { 65static struct sh_clk_ops *sh5_clk_ops[] = {
66 &sh5_master_clk_ops, 66 &sh5_master_clk_ops,
67 &sh5_module_clk_ops, 67 &sh5_module_clk_ops,
68 &sh5_bus_clk_ops, 68 &sh5_bus_clk_ops,
69 &sh5_cpu_clk_ops, 69 &sh5_cpu_clk_ops,
70}; 70};
71 71
72void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 72void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
73{ 73{
74 cprc_base = (unsigned long)ioremap_nocache(CPRC_BASE, 1024); 74 cprc_base = (unsigned long)ioremap_nocache(CPRC_BASE, 1024);
75 BUG_ON(!cprc_base); 75 BUG_ON(!cprc_base);
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index 406508d4ce74..7e4892826563 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -114,9 +114,7 @@ void cpu_idle(void)
114 114
115 rcu_idle_exit(); 115 rcu_idle_exit();
116 tick_nohz_idle_exit(); 116 tick_nohz_idle_exit();
117 preempt_enable_no_resched(); 117 schedule_preempt_disabled();
118 schedule();
119 preempt_disable();
120 } 118 }
121} 119}
122 120
diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c
index 10b14e3a7eb8..068b8a2759b5 100644
--- a/arch/sh/kernel/perf_event.c
+++ b/arch/sh/kernel/perf_event.c
@@ -310,6 +310,10 @@ static int sh_pmu_event_init(struct perf_event *event)
310{ 310{
311 int err; 311 int err;
312 312
313 /* does not support taken branch sampling */
314 if (has_branch_stack(event))
315 return -EOPNOTSUPP;
316
313 switch (event->attr.type) { 317 switch (event->attr.type) {
314 case PERF_TYPE_RAW: 318 case PERF_TYPE_RAW:
315 case PERF_TYPE_HW_CACHE: 319 case PERF_TYPE_HW_CACHE:
diff --git a/arch/sh/kernel/vsyscall/vsyscall.c b/arch/sh/kernel/vsyscall/vsyscall.c
index 1d6d51a1ce79..5ca579720a09 100644
--- a/arch/sh/kernel/vsyscall/vsyscall.c
+++ b/arch/sh/kernel/vsyscall/vsyscall.c
@@ -73,8 +73,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
73 73
74 ret = install_special_mapping(mm, addr, PAGE_SIZE, 74 ret = install_special_mapping(mm, addr, PAGE_SIZE,
75 VM_READ | VM_EXEC | 75 VM_READ | VM_EXEC |
76 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | 76 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC,
77 VM_ALWAYSDUMP,
78 syscall_pages); 77 syscall_pages);
79 if (unlikely(ret)) 78 if (unlikely(ret))
80 goto up_fail; 79 goto up_fail;
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
index 92eb98633ab0..112fea12522a 100644
--- a/arch/sh/mm/cache-sh4.c
+++ b/arch/sh/mm/cache-sh4.c
@@ -244,7 +244,7 @@ static void sh4_flush_cache_page(void *args)
244 if (map_coherent) 244 if (map_coherent)
245 vaddr = kmap_coherent(page, address); 245 vaddr = kmap_coherent(page, address);
246 else 246 else
247 vaddr = kmap_atomic(page, KM_USER0); 247 vaddr = kmap_atomic(page);
248 248
249 address = (unsigned long)vaddr; 249 address = (unsigned long)vaddr;
250 } 250 }
@@ -259,7 +259,7 @@ static void sh4_flush_cache_page(void *args)
259 if (map_coherent) 259 if (map_coherent)
260 kunmap_coherent(vaddr); 260 kunmap_coherent(vaddr);
261 else 261 else
262 kunmap_atomic(vaddr, KM_USER0); 262 kunmap_atomic(vaddr);
263 } 263 }
264} 264}
265 265
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c
index 5a580ea04429..616966a96cba 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -95,7 +95,7 @@ void copy_user_highpage(struct page *to, struct page *from,
95{ 95{
96 void *vfrom, *vto; 96 void *vfrom, *vto;
97 97
98 vto = kmap_atomic(to, KM_USER1); 98 vto = kmap_atomic(to);
99 99
100 if (boot_cpu_data.dcache.n_aliases && page_mapped(from) && 100 if (boot_cpu_data.dcache.n_aliases && page_mapped(from) &&
101 test_bit(PG_dcache_clean, &from->flags)) { 101 test_bit(PG_dcache_clean, &from->flags)) {
@@ -103,16 +103,16 @@ void copy_user_highpage(struct page *to, struct page *from,
103 copy_page(vto, vfrom); 103 copy_page(vto, vfrom);
104 kunmap_coherent(vfrom); 104 kunmap_coherent(vfrom);
105 } else { 105 } else {
106 vfrom = kmap_atomic(from, KM_USER0); 106 vfrom = kmap_atomic(from);
107 copy_page(vto, vfrom); 107 copy_page(vto, vfrom);
108 kunmap_atomic(vfrom, KM_USER0); 108 kunmap_atomic(vfrom);
109 } 109 }
110 110
111 if (pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK) || 111 if (pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK) ||
112 (vma->vm_flags & VM_EXEC)) 112 (vma->vm_flags & VM_EXEC))
113 __flush_purge_region(vto, PAGE_SIZE); 113 __flush_purge_region(vto, PAGE_SIZE);
114 114
115 kunmap_atomic(vto, KM_USER1); 115 kunmap_atomic(vto);
116 /* Make sure this page is cleared on other CPU's too before using it */ 116 /* Make sure this page is cleared on other CPU's too before using it */
117 smp_wmb(); 117 smp_wmb();
118} 118}
@@ -120,14 +120,14 @@ EXPORT_SYMBOL(copy_user_highpage);
120 120
121void clear_user_highpage(struct page *page, unsigned long vaddr) 121void clear_user_highpage(struct page *page, unsigned long vaddr)
122{ 122{
123 void *kaddr = kmap_atomic(page, KM_USER0); 123 void *kaddr = kmap_atomic(page);
124 124
125 clear_page(kaddr); 125 clear_page(kaddr);
126 126
127 if (pages_do_alias((unsigned long)kaddr, vaddr & PAGE_MASK)) 127 if (pages_do_alias((unsigned long)kaddr, vaddr & PAGE_MASK))
128 __flush_purge_region(kaddr, PAGE_SIZE); 128 __flush_purge_region(kaddr, PAGE_SIZE);
129 129
130 kunmap_atomic(kaddr, KM_USER0); 130 kunmap_atomic(kaddr);
131} 131}
132EXPORT_SYMBOL(clear_user_highpage); 132EXPORT_SYMBOL(clear_user_highpage);
133 133