]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP clock: drop clk_get_usecount()
authorPaul Walmsley <paul@pwsan.com>
Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)
committerTony Lindgren <tony@atomide.com>
Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)
This function is race-prone and mistakenly conveys the impression to
drivers that it is part of the clock interface.  Get rid of it: core
code that absolutely needs this can just check clk->usecount.  Drivers
should not use it at all.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/pm-debug.c
arch/arm/mach-omap2/pm24xx.c
arch/arm/plat-omap/clock.c
arch/arm/plat-omap/include/mach/clock.h

index 0b5c0445e7c9bc906926f3eb09140aab2c5c4e4c..0832e05520e403149fe3b2ad11fc241d42ee11b8 100644 (file)
@@ -93,7 +93,7 @@ void serial_console_sleep(int enable)
 
        if (enable) {
                BUG_ON(serial_console_clock_disabled);
-               if (clk_get_usecount(console_fclk) == 0)
+               if (console_fclk->usecount == 0)
                        return;
                if ((int) serial_console_next_disable - (int) omap2_read_32k_sync_counter() >= 0)
                        return;
index 60ff04f3f4c08692af86ed7b8de399e08ac683a8..2798e87ce6bd7e09fc0e12441fd4f2a8005a69e7 100644 (file)
@@ -249,7 +249,7 @@ static int omap2_can_sleep(void)
                return 0;
        if (atomic_read(&sleep_block) > 0)
                return 0;
-       if (clk_get_usecount(osc_ck) > 1)
+       if (osc_ck->usecount > 1)
                return 0;
        if (omap_dma_running())
                return 0;
index ab3d87910a17da2ecd73af4379e8afa6a7a430fe..8d43d78f012156a8c871cba808ae24cdc6fafc5b 100644 (file)
@@ -260,22 +260,6 @@ out:
 }
 EXPORT_SYMBOL(clk_disable);
 
-int clk_get_usecount(struct clk *clk)
-{
-       unsigned long flags;
-       int ret = 0;
-
-       if (clk == NULL || IS_ERR(clk))
-               return 0;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-       ret = clk->usecount;
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(clk_get_usecount);
-
 unsigned long clk_get_rate(struct clk *clk)
 {
        unsigned long flags;
index 9d38a255e94ae659e906b22ac583b595afa691ca..2a30268fe97547dc5b30386cc81d27b897f3a183 100644 (file)
@@ -142,7 +142,6 @@ extern void followparent_recalc(struct clk *clk, unsigned long parent_rate,
                                u8 rate_storage);
 extern void clk_allow_idle(struct clk *clk);
 extern void clk_deny_idle(struct clk *clk);
-extern int clk_get_usecount(struct clk *clk);
 extern void clk_enable_init_clocks(void);
 #ifdef CONFIG_CPU_FREQ
 extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);