ARM: tegra: no warnings on powergate.c
Philip Rakity [Thu, 5 Sep 2013 12:43:09 +0000 (13:43 +0100)]
c requires declaration occur before code

Change-Id: I4f06d5c20602fc7c8f43030683e4c3a46b5e501a
Signed-off-by: Philip Rakity <prakity@nvidia.com>
Reviewed-on: http://git-master/r/270827
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
(cherry picked from commit af15900375a8602354094c43eb5abbcd93f3955e)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>

arch/arm/mach-tegra/powergate.c

index 329285d..1b88a8f 100644 (file)
@@ -59,10 +59,6 @@ int tegra_powergate_set(int id, bool new_state)
        unsigned long flags;
        spinlock_t *lock;
 
-       if (tegra_cpu_is_asim())
-               return 0;
-
-       lock = tegra_get_powergate_lock();
        /* 10us timeout for toggle operation if it takes affect*/
        int toggle_timeout = 10;
 
@@ -70,6 +66,11 @@ int tegra_powergate_set(int id, bool new_state)
           of contention with h/w initiated CPU power gating */
        int contention_timeout = 100;
 
+       if (tegra_cpu_is_asim())
+               return 0;
+
+       lock = tegra_get_powergate_lock();
+
        spin_lock_irqsave(lock, flags);
 
        status = !!(pmc_read(PWRGATE_STATUS) & (1 << id));