diff mbox

[V2,12/20] cpufreq: Mark policy->governor = NULL for inactive policies

Message ID CAKohpo=wyQ-_+B-rycMfoi1KpSWrBJWQx4JAanca=p+1OpJgUA@mail.gmail.com
State New
Headers show

Commit Message

Viresh Kumar April 4, 2015, 3:07 a.m. UTC
On 4 April 2015 at 06:50, Saravana Kannan <skannan@codeaurora.org> wrote:
> I would strongly prefer that this is not done and just clear out the pointer
> if/when the governor module is removed.

Okay, I give up ..

This looks fine ?

        return policy;
@@ -2156,8 +2155,10 @@ void cpufreq_unregister_governor(struct
cpufreq_governor *governor)
        /* clear last_governor for all inactive policies */
        read_lock_irqsave(&cpufreq_driver_lock, flags);
        for_each_inactive_policy(policy, tpolicy) {
-               if (!strcmp(policy->last_governor, governor->name))
+               if (!strcmp(policy->last_governor, governor->name)) {
+                       policy->governor = NULL;
                        strcpy(policy->last_governor, "\0");
+               }
        }
        read_unlock_irqrestore(&cpufreq_driver_lock, flags);
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 4604ad5d9c0c..1f285b06d473 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1094,7 +1094,6 @@  static struct cpufreq_policy
*cpufreq_policy_restore(unsigned int cpu)
        if (likely(policy)) {
                /* Policy should be inactive here */
                WARN_ON(!policy_is_inactive(policy));
-               policy->governor = NULL;
        }