UPSTREAM: PCI: rockchip: remove the pointer to L1 substate cap
[firefly-linux-kernel-4.4.55.git] / drivers / cpuidle / cpuidle.c
index 17a6dc0e211110f00ac2e73728414f161d5a194f..151971627757b0ce968636cb3100375ac68852e5 100644 (file)
@@ -192,7 +192,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
        }
 
        /* Take note of the planned idle state. */
-       sched_idle_set_state(target_state);
+       sched_idle_set_state(target_state, index);
 
        trace_cpu_idle_rcuidle(index, dev->cpu);
        time_start = ktime_get();
@@ -205,7 +205,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
        trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
 
        /* The cpu is no longer idle or about to enter idle. */
-       sched_idle_set_state(NULL);
+       sched_idle_set_state(NULL, -1);
 
        if (broadcast) {
                if (WARN_ON_ONCE(!irqs_disabled()))
@@ -214,7 +214,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
                tick_broadcast_exit();
        }
 
-       if (!cpuidle_state_is_coupled(drv, entered_state))
+       if (!cpuidle_state_is_coupled(drv, index))
                local_irq_enable();
 
        diff = ktime_to_us(ktime_sub(time_end, time_start));
@@ -433,6 +433,8 @@ static void __cpuidle_unregister_device(struct cpuidle_device *dev)
        list_del(&dev->device_list);
        per_cpu(cpuidle_devices, dev->cpu) = NULL;
        module_put(drv->owner);
+
+       dev->registered = 0;
 }
 
 static void __cpuidle_device_init(struct cpuidle_device *dev)