cpuquiet: Properly return the first registered governor
authorSai Charan Gurrappadi <sgurrappadi@nvidia.com>
Fri, 22 Jun 2012 22:42:59 +0000 (15:42 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 18 May 2015 08:07:06 +0000 (16:07 +0800)
Change-Id: I8a21a15d5cf8e4c91a166810387b5d8f1dd7cdb6
Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/111284
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Rebase-Id: R5df2ed43a42e0bd32eee1601a6f945bf6df90227

drivers/cpuquiet/governor.c

index 1446b9ee50665e38c2cbfdc648024c44011aa2d9..7895fccc7f42e9c04dac184acfd55dba97c888bb 100644 (file)
@@ -28,7 +28,8 @@ struct cpuquiet_governor *cpuquiet_curr_governor;
 struct cpuquiet_governor *cpuquiet_get_first_governor(void)
 {
        if (!list_empty(&cpuquiet_governors))
-               return list_entry(&cpuquiet_governors, struct cpuquiet_governor,
+               return list_entry(cpuquiet_governors.next,
+                                       struct cpuquiet_governor,
                                        governor_list);
        else
                return NULL;