diff options
33 files changed, 40 insertions, 92 deletions
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c index aae5bc01acc8..446b696196e3 100644 --- a/arch/arm/common/clkdev.c +++ b/arch/arm/common/clkdev.c | |||
| @@ -99,6 +99,16 @@ void clkdev_add(struct clk_lookup *cl) | |||
| 99 | } | 99 | } |
| 100 | EXPORT_SYMBOL(clkdev_add); | 100 | EXPORT_SYMBOL(clkdev_add); |
| 101 | 101 | ||
| 102 | void __init clkdev_add_table(struct clk_lookup *cl, size_t num) | ||
| 103 | { | ||
| 104 | mutex_lock(&clocks_mutex); | ||
| 105 | while (num--) { | ||
| 106 | list_add_tail(&cl->node, &clocks); | ||
| 107 | cl++; | ||
| 108 | } | ||
| 109 | mutex_unlock(&clocks_mutex); | ||
| 110 | } | ||
| 111 | |||
| 102 | #define MAX_DEV_ID 20 | 112 | #define MAX_DEV_ID 20 |
| 103 | #define MAX_CON_ID 16 | 113 | #define MAX_CON_ID 16 |
| 104 | 114 | ||
diff --git a/arch/arm/include/asm/clkdev.h b/arch/arm/include/asm/clkdev.h index b6ec7c627b39..7a0690da5e63 100644 --- a/arch/arm/include/asm/clkdev.h +++ b/arch/arm/include/asm/clkdev.h | |||
| @@ -27,4 +27,7 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | |||
| 27 | void clkdev_add(struct clk_lookup *cl); | 27 | void clkdev_add(struct clk_lookup *cl); |
| 28 | void clkdev_drop(struct clk_lookup *cl); | 28 | void clkdev_drop(struct clk_lookup *cl); |
| 29 | 29 | ||
| 30 | void clkdev_add_table(struct clk_lookup *, size_t); | ||
| 31 | int clk_add_alias(const char *, const char *, char *, struct device *); | ||
| 32 | |||
| 30 | #endif | 33 | #endif |
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c index e590bbe0a7b4..72e405df0fb0 100644 --- a/arch/arm/mach-bcmring/core.c +++ b/arch/arm/mach-bcmring/core.c | |||
| @@ -142,8 +142,7 @@ void __init bcmring_amba_init(void) | |||
| 142 | 142 | ||
| 143 | chipcHw_busInterfaceClockEnable(bus_clock); | 143 | chipcHw_busInterfaceClockEnable(bus_clock); |
| 144 | 144 | ||
| 145 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 145 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 146 | clkdev_add(&lookups[i]); | ||
| 147 | 146 | ||
| 148 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 147 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
| 149 | struct amba_device *d = amba_devs[i]; | 148 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 1d0f9d8aff2e..bb3c62196442 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
| @@ -445,7 +445,6 @@ static void __init ep93xx_dma_clock_init(void) | |||
| 445 | static int __init ep93xx_clock_init(void) | 445 | static int __init ep93xx_clock_init(void) |
| 446 | { | 446 | { |
| 447 | u32 value; | 447 | u32 value; |
| 448 | int i; | ||
| 449 | 448 | ||
| 450 | value = __raw_readl(EP93XX_SYSCON_CLOCK_SET1); | 449 | value = __raw_readl(EP93XX_SYSCON_CLOCK_SET1); |
| 451 | if (!(value & 0x00800000)) { /* PLL1 bypassed? */ | 450 | if (!(value & 0x00800000)) { /* PLL1 bypassed? */ |
| @@ -474,8 +473,7 @@ static int __init ep93xx_clock_init(void) | |||
| 474 | clk_f.rate / 1000000, clk_h.rate / 1000000, | 473 | clk_f.rate / 1000000, clk_h.rate / 1000000, |
| 475 | clk_p.rate / 1000000); | 474 | clk_p.rate / 1000000); |
| 476 | 475 | ||
| 477 | for (i = 0; i < ARRAY_SIZE(clocks); i++) | 476 | clkdev_add_table(clocks, ARRAY_SIZE(clocks)); |
| 478 | clkdev_add(&clocks[i]); | ||
| 479 | return 0; | 477 | return 0; |
| 480 | } | 478 | } |
| 481 | arch_initcall(ep93xx_clock_init); | 479 | arch_initcall(ep93xx_clock_init); |
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index a0f60e55da6a..8b390e36ba69 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c | |||
| @@ -144,8 +144,7 @@ static int __init integrator_init(void) | |||
| 144 | { | 144 | { |
| 145 | int i; | 145 | int i; |
| 146 | 146 | ||
| 147 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 147 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 148 | clkdev_add(&lookups[i]); | ||
| 149 | 148 | ||
| 150 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 149 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
| 151 | struct amba_device *d = amba_devs[i]; | 150 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 3f35293d457a..66ef86d6d9e3 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
| @@ -558,9 +558,7 @@ static void __init intcp_init(void) | |||
| 558 | { | 558 | { |
| 559 | int i; | 559 | int i; |
| 560 | 560 | ||
| 561 | for (i = 0; i < ARRAY_SIZE(cp_lookups); i++) | 561 | clkdev_add_table(cp_lookups, ARRAY_SIZE(cp_lookups)); |
| 562 | clkdev_add(&cp_lookups[i]); | ||
| 563 | |||
| 564 | platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); | 562 | platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); |
| 565 | 563 | ||
| 566 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 564 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c index 2a46ed5cc2a2..886e05648f08 100644 --- a/arch/arm/mach-mmp/clock.c +++ b/arch/arm/mach-mmp/clock.c | |||
| @@ -88,11 +88,3 @@ unsigned long clk_get_rate(struct clk *clk) | |||
| 88 | return rate; | 88 | return rate; |
| 89 | } | 89 | } |
| 90 | EXPORT_SYMBOL(clk_get_rate); | 90 | EXPORT_SYMBOL(clk_get_rate); |
| 91 | |||
| 92 | void clks_register(struct clk_lookup *clks, size_t num) | ||
| 93 | { | ||
| 94 | int i; | ||
| 95 | |||
| 96 | for (i = 0; i < num; i++) | ||
| 97 | clkdev_add(&clks[i]); | ||
| 98 | } | ||
diff --git a/arch/arm/mach-mmp/clock.h b/arch/arm/mach-mmp/clock.h index eefffbe683b0..016ae94691c0 100644 --- a/arch/arm/mach-mmp/clock.h +++ b/arch/arm/mach-mmp/clock.h | |||
| @@ -68,5 +68,3 @@ struct clk clk_##_name = { \ | |||
| 68 | 68 | ||
| 69 | extern struct clk clk_pxa168_gpio; | 69 | extern struct clk clk_pxa168_gpio; |
| 70 | extern struct clk clk_pxa168_timers; | 70 | extern struct clk clk_pxa168_timers; |
| 71 | |||
| 72 | extern void clks_register(struct clk_lookup *, size_t); | ||
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 37dbdde17fac..1873c821df90 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
| @@ -94,7 +94,7 @@ static int __init pxa168_init(void) | |||
| 94 | mfp_init_base(MFPR_VIRT_BASE); | 94 | mfp_init_base(MFPR_VIRT_BASE); |
| 95 | mfp_init_addr(pxa168_mfp_addr_map); | 95 | mfp_init_addr(pxa168_mfp_addr_map); |
| 96 | pxa_init_dma(IRQ_PXA168_DMA_INT0, 32); | 96 | pxa_init_dma(IRQ_PXA168_DMA_INT0, 32); |
| 97 | clks_register(ARRAY_AND_SIZE(pxa168_clkregs)); | 97 | clkdev_add_table(ARRAY_AND_SIZE(pxa168_clkregs)); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | return 0; | 100 | return 0; |
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index d4049508a4df..46f2d69bef3c 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
| @@ -131,7 +131,7 @@ static int __init pxa910_init(void) | |||
| 131 | mfp_init_base(MFPR_VIRT_BASE); | 131 | mfp_init_base(MFPR_VIRT_BASE); |
| 132 | mfp_init_addr(pxa910_mfp_addr_map); | 132 | mfp_init_addr(pxa910_mfp_addr_map); |
| 133 | pxa_init_dma(IRQ_PXA910_DMA_INT0, 32); | 133 | pxa_init_dma(IRQ_PXA910_DMA_INT0, 32); |
| 134 | clks_register(ARRAY_AND_SIZE(pxa910_clkregs)); | 134 | clkdev_add_table(ARRAY_AND_SIZE(pxa910_clkregs)); |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | return 0; | 137 | return 0; |
diff --git a/arch/arm/mach-mx1/clock.c b/arch/arm/mach-mx1/clock.c index d1b588519ad2..6cf2d4a7511d 100644 --- a/arch/arm/mach-mx1/clock.c +++ b/arch/arm/mach-mx1/clock.c | |||
| @@ -570,7 +570,6 @@ static struct clk_lookup lookups[] __initdata = { | |||
| 570 | int __init mx1_clocks_init(unsigned long fref) | 570 | int __init mx1_clocks_init(unsigned long fref) |
| 571 | { | 571 | { |
| 572 | unsigned int reg; | 572 | unsigned int reg; |
| 573 | int i; | ||
| 574 | 573 | ||
| 575 | /* disable clocks we are able to */ | 574 | /* disable clocks we are able to */ |
| 576 | __raw_writel(0, SCM_GCCR); | 575 | __raw_writel(0, SCM_GCCR); |
| @@ -592,8 +591,7 @@ int __init mx1_clocks_init(unsigned long fref) | |||
| 592 | reg = (reg & CCM_CSCR_CLKO_MASK) >> CCM_CSCR_CLKO_OFFSET; | 591 | reg = (reg & CCM_CSCR_CLKO_MASK) >> CCM_CSCR_CLKO_OFFSET; |
| 593 | clko_clk.parent = (struct clk *)clko_clocks[reg]; | 592 | clko_clk.parent = (struct clk *)clko_clocks[reg]; |
| 594 | 593 | ||
| 595 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 594 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 596 | clkdev_add(&lookups[i]); | ||
| 597 | 595 | ||
| 598 | clk_enable(&hclk); | 596 | clk_enable(&hclk); |
| 599 | clk_enable(&fclk); | 597 | clk_enable(&fclk); |
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c index 91901b5d56c2..e82b489d1215 100644 --- a/arch/arm/mach-mx2/clock_imx21.c +++ b/arch/arm/mach-mx2/clock_imx21.c | |||
| @@ -968,7 +968,6 @@ static struct clk_lookup lookups[] = { | |||
| 968 | */ | 968 | */ |
| 969 | int __init mx21_clocks_init(unsigned long lref, unsigned long href) | 969 | int __init mx21_clocks_init(unsigned long lref, unsigned long href) |
| 970 | { | 970 | { |
| 971 | int i; | ||
| 972 | u32 cscr; | 971 | u32 cscr; |
| 973 | 972 | ||
| 974 | external_low_reference = lref; | 973 | external_low_reference = lref; |
| @@ -986,8 +985,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href) | |||
| 986 | else | 985 | else |
| 987 | spll_clk.parent = &fpm_clk; | 986 | spll_clk.parent = &fpm_clk; |
| 988 | 987 | ||
| 989 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 988 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 990 | clkdev_add(&lookups[i]); | ||
| 991 | 989 | ||
| 992 | /* Turn off all clock gates */ | 990 | /* Turn off all clock gates */ |
| 993 | __raw_writel(0, CCM_PCCR0); | 991 | __raw_writel(0, CCM_PCCR0); |
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c index b010bf9ceaab..18c53a6487fa 100644 --- a/arch/arm/mach-mx2/clock_imx27.c +++ b/arch/arm/mach-mx2/clock_imx27.c | |||
| @@ -719,7 +719,6 @@ static void __init to2_adjust_clocks(void) | |||
| 719 | int __init mx27_clocks_init(unsigned long fref) | 719 | int __init mx27_clocks_init(unsigned long fref) |
| 720 | { | 720 | { |
| 721 | u32 cscr = __raw_readl(CCM_CSCR); | 721 | u32 cscr = __raw_readl(CCM_CSCR); |
| 722 | int i; | ||
| 723 | 722 | ||
| 724 | external_high_reference = fref; | 723 | external_high_reference = fref; |
| 725 | 724 | ||
| @@ -736,8 +735,7 @@ int __init mx27_clocks_init(unsigned long fref) | |||
| 736 | 735 | ||
| 737 | to2_adjust_clocks(); | 736 | to2_adjust_clocks(); |
| 738 | 737 | ||
| 739 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 738 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 740 | clkdev_add(&lookups[i]); | ||
| 741 | 739 | ||
| 742 | /* Turn off all clocks we do not need */ | 740 | /* Turn off all clocks we do not need */ |
| 743 | __raw_writel(0, CCM_PCCR0); | 741 | __raw_writel(0, CCM_PCCR0); |
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c index 6e838b857712..66916f104812 100644 --- a/arch/arm/mach-mx25/clock.c +++ b/arch/arm/mach-mx25/clock.c | |||
| @@ -210,11 +210,7 @@ static struct clk_lookup lookups[] = { | |||
| 210 | 210 | ||
| 211 | int __init mx25_clocks_init(unsigned long fref) | 211 | int __init mx25_clocks_init(unsigned long fref) |
| 212 | { | 212 | { |
| 213 | int i; | 213 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 214 | |||
| 215 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | ||
| 216 | clkdev_add(&lookups[i]); | ||
| 217 | |||
| 218 | mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); | 214 | mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); |
| 219 | 215 | ||
| 220 | return 0; | 216 | return 0; |
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c index 7584b4c6c556..f3f41fa4f21b 100644 --- a/arch/arm/mach-mx3/clock-imx35.c +++ b/arch/arm/mach-mx3/clock-imx35.c | |||
| @@ -485,15 +485,13 @@ static struct clk_lookup lookups[] = { | |||
| 485 | 485 | ||
| 486 | int __init mx35_clocks_init() | 486 | int __init mx35_clocks_init() |
| 487 | { | 487 | { |
| 488 | int i; | ||
| 489 | unsigned int ll = 0; | 488 | unsigned int ll = 0; |
| 490 | 489 | ||
| 491 | #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) | 490 | #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) |
| 492 | ll = (3 << 16); | 491 | ll = (3 << 16); |
| 493 | #endif | 492 | #endif |
| 494 | 493 | ||
| 495 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 494 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 496 | clkdev_add(&lookups[i]); | ||
| 497 | 495 | ||
| 498 | /* Turn off all clocks except the ones we need to survive, namely: | 496 | /* Turn off all clocks except the ones we need to survive, namely: |
| 499 | * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart | 497 | * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart |
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c index 27a318af0d20..b5c39a016db7 100644 --- a/arch/arm/mach-mx3/clock.c +++ b/arch/arm/mach-mx3/clock.c | |||
| @@ -578,12 +578,10 @@ static struct clk_lookup lookups[] = { | |||
| 578 | int __init mx31_clocks_init(unsigned long fref) | 578 | int __init mx31_clocks_init(unsigned long fref) |
| 579 | { | 579 | { |
| 580 | u32 reg; | 580 | u32 reg; |
| 581 | int i; | ||
| 582 | 581 | ||
| 583 | ckih_rate = fref; | 582 | ckih_rate = fref; |
| 584 | 583 | ||
| 585 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 584 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 586 | clkdev_add(&lookups[i]); | ||
| 587 | 585 | ||
| 588 | /* change the csi_clk parent if necessary */ | 586 | /* change the csi_clk parent if necessary */ |
| 589 | reg = __raw_readl(MXC_CCM_CCMR); | 587 | reg = __raw_readl(MXC_CCM_CCMR); |
diff --git a/arch/arm/mach-mxc91231/clock.c b/arch/arm/mach-mxc91231/clock.c index ecfa37fef8ad..5c85075d8a56 100644 --- a/arch/arm/mach-mxc91231/clock.c +++ b/arch/arm/mach-mxc91231/clock.c | |||
| @@ -624,7 +624,6 @@ static struct clk_lookup lookups[] = { | |||
| 624 | int __init mxc91231_clocks_init(unsigned long fref) | 624 | int __init mxc91231_clocks_init(unsigned long fref) |
| 625 | { | 625 | { |
| 626 | void __iomem *gpt_base; | 626 | void __iomem *gpt_base; |
| 627 | int i; | ||
| 628 | 627 | ||
| 629 | ckih_rate = fref; | 628 | ckih_rate = fref; |
| 630 | 629 | ||
| @@ -632,8 +631,7 @@ int __init mxc91231_clocks_init(unsigned long fref) | |||
| 632 | sdhc_clk[0].parent = clk_sdhc_parent(&sdhc_clk[0]); | 631 | sdhc_clk[0].parent = clk_sdhc_parent(&sdhc_clk[0]); |
| 633 | sdhc_clk[1].parent = clk_sdhc_parent(&sdhc_clk[1]); | 632 | sdhc_clk[1].parent = clk_sdhc_parent(&sdhc_clk[1]); |
| 634 | 633 | ||
| 635 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 634 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 636 | clkdev_add(&lookups[i]); | ||
| 637 | 635 | ||
| 638 | gpt_base = MXC91231_IO_ADDRESS(MXC91231_GPT1_BASE_ADDR); | 636 | gpt_base = MXC91231_IO_ADDRESS(MXC91231_GPT1_BASE_ADDR); |
| 639 | mxc_timer_init(&gpt_clk, gpt_base, MXC91231_INT_GPT); | 637 | mxc_timer_init(&gpt_clk, gpt_base, MXC91231_INT_GPT); |
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c index 49ae38292310..abba0089a2ae 100644 --- a/arch/arm/mach-pxa/clock.c +++ b/arch/arm/mach-pxa/clock.c | |||
| @@ -78,11 +78,3 @@ const struct clkops clk_cken_ops = { | |||
| 78 | .enable = clk_cken_enable, | 78 | .enable = clk_cken_enable, |
| 79 | .disable = clk_cken_disable, | 79 | .disable = clk_cken_disable, |
| 80 | }; | 80 | }; |
| 81 | |||
| 82 | void clks_register(struct clk_lookup *clks, size_t num) | ||
| 83 | { | ||
| 84 | int i; | ||
| 85 | |||
| 86 | for (i = 0; i < num; i++) | ||
| 87 | clkdev_add(&clks[i]); | ||
| 88 | } | ||
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h index 978a3667e90d..d8488742b807 100644 --- a/arch/arm/mach-pxa/clock.h +++ b/arch/arm/mach-pxa/clock.h | |||
| @@ -67,7 +67,3 @@ extern void clk_pxa3xx_cken_enable(struct clk *); | |||
| 67 | extern void clk_pxa3xx_cken_disable(struct clk *); | 67 | extern void clk_pxa3xx_cken_disable(struct clk *); |
| 68 | #endif | 68 | #endif |
| 69 | 69 | ||
| 70 | void clks_register(struct clk_lookup *clks, size_t num); | ||
| 71 | int clk_add_alias(const char *alias, const char *alias_name, char *id, | ||
| 72 | struct device *dev); | ||
| 73 | |||
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index 91417f035069..96ed13081639 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
| @@ -128,6 +128,6 @@ static struct clk_lookup eseries_clkregs[] = { | |||
| 128 | 128 | ||
| 129 | void eseries_register_clks(void) | 129 | void eseries_register_clks(void) |
| 130 | { | 130 | { |
| 131 | clks_register(eseries_clkregs, ARRAY_SIZE(eseries_clkregs)); | 131 | clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs)); |
| 132 | } | 132 | } |
| 133 | 133 | ||
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 2c1b0b70d01d..0b9ad30bfd51 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
| @@ -349,7 +349,7 @@ static int __init pxa25x_init(void) | |||
| 349 | 349 | ||
| 350 | reset_status = RCSR; | 350 | reset_status = RCSR; |
| 351 | 351 | ||
| 352 | clks_register(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs)); | 352 | clkdev_add_table(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs)); |
| 353 | 353 | ||
| 354 | if ((ret = pxa_init_dma(IRQ_DMA, 16))) | 354 | if ((ret = pxa_init_dma(IRQ_DMA, 16))) |
| 355 | return ret; | 355 | return ret; |
| @@ -370,7 +370,7 @@ static int __init pxa25x_init(void) | |||
| 370 | 370 | ||
| 371 | /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */ | 371 | /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */ |
| 372 | if (cpu_is_pxa255()) | 372 | if (cpu_is_pxa255()) |
| 373 | clks_register(&pxa25x_hwuart_clkreg, 1); | 373 | clkdev_add(&pxa25x_hwuart_clkreg); |
| 374 | 374 | ||
| 375 | return ret; | 375 | return ret; |
| 376 | } | 376 | } |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 6a0b73167e03..d783123e2d48 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
| @@ -392,7 +392,7 @@ static int __init pxa27x_init(void) | |||
| 392 | 392 | ||
| 393 | reset_status = RCSR; | 393 | reset_status = RCSR; |
| 394 | 394 | ||
| 395 | clks_register(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs)); | 395 | clkdev_add_table(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs)); |
| 396 | 396 | ||
| 397 | if ((ret = pxa_init_dma(IRQ_DMA, 32))) | 397 | if ((ret = pxa_init_dma(IRQ_DMA, 32))) |
| 398 | return ret; | 398 | return ret; |
diff --git a/arch/arm/mach-pxa/pxa300.c b/arch/arm/mach-pxa/pxa300.c index f4af6e2bef89..40bb16501d86 100644 --- a/arch/arm/mach-pxa/pxa300.c +++ b/arch/arm/mach-pxa/pxa300.c | |||
| @@ -102,12 +102,12 @@ static int __init pxa300_init(void) | |||
| 102 | if (cpu_is_pxa300() || cpu_is_pxa310()) { | 102 | if (cpu_is_pxa300() || cpu_is_pxa310()) { |
| 103 | mfp_init_base(io_p2v(MFPR_BASE)); | 103 | mfp_init_base(io_p2v(MFPR_BASE)); |
| 104 | mfp_init_addr(pxa300_mfp_addr_map); | 104 | mfp_init_addr(pxa300_mfp_addr_map); |
| 105 | clks_register(ARRAY_AND_SIZE(common_clkregs)); | 105 | clkdev_add_table(ARRAY_AND_SIZE(common_clkregs)); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | if (cpu_is_pxa310()) { | 108 | if (cpu_is_pxa310()) { |
| 109 | mfp_init_addr(pxa310_mfp_addr_map); | 109 | mfp_init_addr(pxa310_mfp_addr_map); |
| 110 | clks_register(ARRAY_AND_SIZE(pxa310_clkregs)); | 110 | clkdev_add_table(ARRAY_AND_SIZE(pxa310_clkregs)); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | return 0; | 113 | return 0; |
diff --git a/arch/arm/mach-pxa/pxa320.c b/arch/arm/mach-pxa/pxa320.c index c7373e74a109..8d614ecd8e99 100644 --- a/arch/arm/mach-pxa/pxa320.c +++ b/arch/arm/mach-pxa/pxa320.c | |||
| @@ -90,7 +90,7 @@ static int __init pxa320_init(void) | |||
| 90 | if (cpu_is_pxa320()) { | 90 | if (cpu_is_pxa320()) { |
| 91 | mfp_init_base(io_p2v(MFPR_BASE)); | 91 | mfp_init_base(io_p2v(MFPR_BASE)); |
| 92 | mfp_init_addr(pxa320_mfp_addr_map); | 92 | mfp_init_addr(pxa320_mfp_addr_map); |
| 93 | clks_register(ARRAY_AND_SIZE(pxa320_clkregs)); | 93 | clkdev_add_table(ARRAY_AND_SIZE(pxa320_clkregs)); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | return 0; | 96 | return 0; |
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index fcb0721f4669..4d7c03e72504 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
| @@ -634,7 +634,7 @@ static int __init pxa3xx_init(void) | |||
| 634 | */ | 634 | */ |
| 635 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); | 635 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); |
| 636 | 636 | ||
| 637 | clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs)); | 637 | clkdev_add_table(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs)); |
| 638 | 638 | ||
| 639 | if ((ret = pxa_init_dma(IRQ_DMA, 32))) | 639 | if ((ret = pxa_init_dma(IRQ_DMA, 32))) |
| 640 | return ret; | 640 | return ret; |
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 9f293438e020..90bd4ef71b2c 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
| @@ -346,10 +346,7 @@ static struct clk_lookup lookups[] = { | |||
| 346 | 346 | ||
| 347 | static int __init clk_init(void) | 347 | static int __init clk_init(void) |
| 348 | { | 348 | { |
| 349 | int i; | 349 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 350 | |||
| 351 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | ||
| 352 | clkdev_add(&lookups[i]); | ||
| 353 | return 0; | 350 | return 0; |
| 354 | } | 351 | } |
| 355 | arch_initcall(clk_init); | 352 | arch_initcall(clk_init); |
diff --git a/arch/arm/mach-u300/clock.c b/arch/arm/mach-u300/clock.c index 111f7ea32b38..c174ed1f3691 100644 --- a/arch/arm/mach-u300/clock.c +++ b/arch/arm/mach-u300/clock.c | |||
| @@ -1276,11 +1276,8 @@ static struct clk_lookup lookups[] = { | |||
| 1276 | 1276 | ||
| 1277 | static void __init clk_register(void) | 1277 | static void __init clk_register(void) |
| 1278 | { | 1278 | { |
| 1279 | int i; | ||
| 1280 | |||
| 1281 | /* Register the lookups */ | 1279 | /* Register the lookups */ |
| 1282 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 1280 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 1283 | clkdev_add(&lookups[i]); | ||
| 1284 | } | 1281 | } |
| 1285 | 1282 | ||
| 1286 | /* | 1283 | /* |
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c index 20b6ebb6783a..8359a73d0041 100644 --- a/arch/arm/mach-ux500/clock.c +++ b/arch/arm/mach-ux500/clock.c | |||
| @@ -85,11 +85,8 @@ static struct clk_lookup lookups[] = { | |||
| 85 | 85 | ||
| 86 | static int __init clk_init(void) | 86 | static int __init clk_init(void) |
| 87 | { | 87 | { |
| 88 | int i; | ||
| 89 | |||
| 90 | /* register the clock lookups */ | 88 | /* register the clock lookups */ |
| 91 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 89 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 92 | clkdev_add(&lookups[i]); | ||
| 93 | return 0; | 90 | return 0; |
| 94 | } | 91 | } |
| 95 | arch_initcall(clk_init); | 92 | arch_initcall(clk_init); |
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index e13be7c444ca..9ddb49b1cb71 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
| @@ -851,8 +851,7 @@ void __init versatile_init(void) | |||
| 851 | { | 851 | { |
| 852 | int i; | 852 | int i; |
| 853 | 853 | ||
| 854 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 854 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 855 | clkdev_add(&lookups[i]); | ||
| 856 | 855 | ||
| 857 | platform_device_register(&versatile_flash_device); | 856 | platform_device_register(&versatile_flash_device); |
| 858 | platform_device_register(&versatile_i2c_device); | 857 | platform_device_register(&versatile_i2c_device); |
diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c index b785994bab0a..2c371ff22e51 100644 --- a/arch/arm/mach-w90x900/clock.c +++ b/arch/arm/mach-w90x900/clock.c | |||
| @@ -90,12 +90,3 @@ void nuc900_subclk_enable(struct clk *clk, int enable) | |||
| 90 | 90 | ||
| 91 | __raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK); | 91 | __raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK); |
| 92 | } | 92 | } |
| 93 | |||
| 94 | |||
| 95 | void clks_register(struct clk_lookup *clks, size_t num) | ||
| 96 | { | ||
| 97 | int i; | ||
| 98 | |||
| 99 | for (i = 0; i < num; i++) | ||
| 100 | clkdev_add(&clks[i]); | ||
| 101 | } | ||
diff --git a/arch/arm/mach-w90x900/clock.h b/arch/arm/mach-w90x900/clock.h index f5816a06eed6..c56ddab3d912 100644 --- a/arch/arm/mach-w90x900/clock.h +++ b/arch/arm/mach-w90x900/clock.h | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | 14 | ||
| 15 | void nuc900_clk_enable(struct clk *clk, int enable); | 15 | void nuc900_clk_enable(struct clk *clk, int enable); |
| 16 | void nuc900_subclk_enable(struct clk *clk, int enable); | 16 | void nuc900_subclk_enable(struct clk *clk, int enable); |
| 17 | void clks_register(struct clk_lookup *clks, size_t num); | ||
| 18 | 17 | ||
| 19 | struct clk { | 18 | struct clk { |
| 20 | unsigned long cken; | 19 | unsigned long cken; |
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c index 20dc0c96214d..6f5ca532883f 100644 --- a/arch/arm/mach-w90x900/cpu.c +++ b/arch/arm/mach-w90x900/cpu.c | |||
| @@ -208,6 +208,6 @@ void __init nuc900_map_io(struct map_desc *mach_desc, int mach_size) | |||
| 208 | 208 | ||
| 209 | void __init nuc900_init_clocks(void) | 209 | void __init nuc900_init_clocks(void) |
| 210 | { | 210 | { |
| 211 | clks_register(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs)); | 211 | clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs)); |
| 212 | } | 212 | } |
| 213 | 213 | ||
diff --git a/arch/arm/plat-stmp3xxx/clock.c b/arch/arm/plat-stmp3xxx/clock.c index 5d2f19a09e44..e593a2a801c6 100644 --- a/arch/arm/plat-stmp3xxx/clock.c +++ b/arch/arm/plat-stmp3xxx/clock.c | |||
| @@ -1126,9 +1126,8 @@ static int __init clk_init(void) | |||
| 1126 | if (ops && ops->set_parent) | 1126 | if (ops && ops->set_parent) |
| 1127 | ops->set_parent(cl->clk, cl->clk->parent); | 1127 | ops->set_parent(cl->clk, cl->clk->parent); |
| 1128 | } | 1128 | } |
| 1129 | |||
| 1130 | clkdev_add(cl); | ||
| 1131 | } | 1129 | } |
| 1130 | clkdev_add_table(onchip_clks, ARRAY_SIZE(onchip_clks)); | ||
| 1132 | return 0; | 1131 | return 0; |
| 1133 | } | 1132 | } |
| 1134 | 1133 | ||
