hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/cpufreq/cpufreq_ondemand.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * drivers/cpufreq/cpufreq_ondemand.c
34 *
45 * Copyright (C) 2001 Russell King
56 * (C) 2003 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>.
67 * Jun Nakajima <jun.nakajima@intel.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -411,7 +408,7 @@
411408 .start = od_start,
412409 };
413410
414
-#define CPU_FREQ_GOV_ONDEMAND (&od_dbs_gov.gov)
411
+#define CPU_FREQ_GOV_ONDEMAND (od_dbs_gov.gov)
415412
416413 static void od_set_powersave_bias(unsigned int powersave_bias)
417414 {
....@@ -432,7 +429,7 @@
432429 continue;
433430
434431 policy = cpufreq_cpu_get_raw(cpu);
435
- if (!policy || policy->governor != CPU_FREQ_GOV_ONDEMAND)
432
+ if (!policy || policy->governor != &CPU_FREQ_GOV_ONDEMAND)
436433 continue;
437434
438435 policy_dbs = policy->governor_data;
....@@ -464,16 +461,6 @@
464461 }
465462 EXPORT_SYMBOL_GPL(od_unregister_powersave_bias_handler);
466463
467
-static int __init cpufreq_gov_dbs_init(void)
468
-{
469
- return cpufreq_register_governor(CPU_FREQ_GOV_ONDEMAND);
470
-}
471
-
472
-static void __exit cpufreq_gov_dbs_exit(void)
473
-{
474
- cpufreq_unregister_governor(CPU_FREQ_GOV_ONDEMAND);
475
-}
476
-
477464 MODULE_AUTHOR("Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>");
478465 MODULE_AUTHOR("Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>");
479466 MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for "
....@@ -483,11 +470,9 @@
483470 #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
484471 struct cpufreq_governor *cpufreq_default_governor(void)
485472 {
486
- return CPU_FREQ_GOV_ONDEMAND;
473
+ return &CPU_FREQ_GOV_ONDEMAND;
487474 }
488
-
489
-fs_initcall(cpufreq_gov_dbs_init);
490
-#else
491
-module_init(cpufreq_gov_dbs_init);
492475 #endif
493
-module_exit(cpufreq_gov_dbs_exit);
476
+
477
+cpufreq_governor_init(CPU_FREQ_GOV_ONDEMAND);
478
+cpufreq_governor_exit(CPU_FREQ_GOV_ONDEMAND);