cpuidle: use drv instead of cpuidle_driver in show_current_driver()
[deliverable/linux.git] / drivers / cpuidle / driver.c
index 6e11701f0fcaef8430e2e8544108df8e337ebbed..2458a741ad4566eebfa19bb22ceb667c4e7419c9 100644 (file)
@@ -56,7 +56,7 @@ static inline void __cpuidle_unset_driver(struct cpuidle_driver *drv)
 }
 
 /**
- * __cpuidle_set_driver - set per CPU driver variables the the given driver.
+ * __cpuidle_set_driver - set per CPU driver variables for the given driver.
  * @drv: a valid pointer to a struct cpuidle_driver
  *
  * For each CPU in the driver's cpumask, unset the registered driver per CPU
@@ -132,7 +132,7 @@ static inline void __cpuidle_unset_driver(struct cpuidle_driver *drv)
  * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer
  * @arg: a void pointer used to match the SMP cross call API
  *
- * @arg is used as a value of type 'long' with on of the two values:
+ * @arg is used as a value of type 'long' with one of the two values:
  * - CLOCK_EVT_NOTIFY_BROADCAST_ON
  * - CLOCK_EVT_NOTIFY_BROADCAST_OFF
  *
@@ -149,10 +149,8 @@ static void cpuidle_setup_broadcast_timer(void *arg)
 /**
  * __cpuidle_driver_init - initialize the driver's internal data
  * @drv: a valid pointer to a struct cpuidle_driver
- *
- * Returns 0 on success, a negative error code otherwise.
  */
-static int __cpuidle_driver_init(struct cpuidle_driver *drv)
+static void __cpuidle_driver_init(struct cpuidle_driver *drv)
 {
        int i;
 
@@ -169,18 +167,14 @@ static int __cpuidle_driver_init(struct cpuidle_driver *drv)
        /*
         * Look for the timer stop flag in the different states, so that we know
         * if the broadcast timer has to be set up.  The loop is in the reverse
-        * order, because usually on of the the deeper states has this flag set.
+        * order, because usually one of the deeper states have this flag set.
         */
        for (i = drv->state_count - 1; i >= 0 ; i--) {
-
-               if (!(drv->states[i].flags & CPUIDLE_FLAG_TIMER_STOP))
-                       continue;
-
-               drv->bctimer = 1;
-               break;
+               if (drv->states[i].flags & CPUIDLE_FLAG_TIMER_STOP) {
+                       drv->bctimer = 1;
+                       break;
+               }
        }
-
-       return 0;
 }
 
 /**
@@ -206,9 +200,7 @@ static int __cpuidle_register_driver(struct cpuidle_driver *drv)
        if (cpuidle_disabled())
                return -ENODEV;
 
-       ret = __cpuidle_driver_init(drv);
-       if (ret)
-               return ret;
+       __cpuidle_driver_init(drv);
 
        ret = __cpuidle_set_driver(drv);
        if (ret)
@@ -346,10 +338,11 @@ struct cpuidle_driver *cpuidle_driver_ref(void)
  */
 void cpuidle_driver_unref(void)
 {
-       struct cpuidle_driver *drv = cpuidle_get_driver();
+       struct cpuidle_driver *drv;
 
        spin_lock(&cpuidle_driver_lock);
 
+       drv = cpuidle_get_driver();
        if (drv && !WARN_ON(drv->refcnt <= 0))
                drv->refcnt--;
 
This page took 0.029201 seconds and 5 git commands to generate.