cpufreq.c (6f84981772535e670e4e2df051a672af229b6694) | cpufreq.c (dd329e1e21b54c73f58a440b6164d04d8a7fc542) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/drivers/cpufreq/cpufreq.c 4 * 5 * Copyright (C) 2001 Russell King 6 * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> 7 * (C) 2013 Viresh Kumar <viresh.kumar@linaro.org> 8 * --- 2890 unchanged lines hidden (view full) --- 2899/* 2900 * cpufreq_unregister_driver - unregister the current CPUFreq driver 2901 * 2902 * Unregister the current CPUFreq driver. Only call this if you have 2903 * the right to do so, i.e. if you have succeeded in initialising before! 2904 * Returns zero if successful, and -EINVAL if the cpufreq_driver is 2905 * currently not initialised. 2906 */ | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * linux/drivers/cpufreq/cpufreq.c 4 * 5 * Copyright (C) 2001 Russell King 6 * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> 7 * (C) 2013 Viresh Kumar <viresh.kumar@linaro.org> 8 * --- 2890 unchanged lines hidden (view full) --- 2899/* 2900 * cpufreq_unregister_driver - unregister the current CPUFreq driver 2901 * 2902 * Unregister the current CPUFreq driver. Only call this if you have 2903 * the right to do so, i.e. if you have succeeded in initialising before! 2904 * Returns zero if successful, and -EINVAL if the cpufreq_driver is 2905 * currently not initialised. 2906 */ |
2907int cpufreq_unregister_driver(struct cpufreq_driver *driver) | 2907void cpufreq_unregister_driver(struct cpufreq_driver *driver) |
2908{ 2909 unsigned long flags; 2910 | 2908{ 2909 unsigned long flags; 2910 |
2911 if (!cpufreq_driver || (driver != cpufreq_driver)) 2912 return -EINVAL; | 2911 if (WARN_ON(!cpufreq_driver || (driver != cpufreq_driver))) 2912 return; |
2913 2914 pr_debug("unregistering driver %s\n", driver->name); 2915 2916 /* Protect against concurrent cpu hotplug */ 2917 cpus_read_lock(); 2918 subsys_interface_unregister(&cpufreq_interface); 2919 remove_boost_sysfs_file(); 2920 static_branch_disable_cpuslocked(&cpufreq_freq_invariance); 2921 cpuhp_remove_state_nocalls_cpuslocked(hp_online); 2922 2923 write_lock_irqsave(&cpufreq_driver_lock, flags); 2924 2925 cpufreq_driver = NULL; 2926 2927 write_unlock_irqrestore(&cpufreq_driver_lock, flags); 2928 cpus_read_unlock(); | 2913 2914 pr_debug("unregistering driver %s\n", driver->name); 2915 2916 /* Protect against concurrent cpu hotplug */ 2917 cpus_read_lock(); 2918 subsys_interface_unregister(&cpufreq_interface); 2919 remove_boost_sysfs_file(); 2920 static_branch_disable_cpuslocked(&cpufreq_freq_invariance); 2921 cpuhp_remove_state_nocalls_cpuslocked(hp_online); 2922 2923 write_lock_irqsave(&cpufreq_driver_lock, flags); 2924 2925 cpufreq_driver = NULL; 2926 2927 write_unlock_irqrestore(&cpufreq_driver_lock, flags); 2928 cpus_read_unlock(); |
2929 2930 return 0; | |
2931} 2932EXPORT_SYMBOL_GPL(cpufreq_unregister_driver); 2933 2934static int __init cpufreq_core_init(void) 2935{ 2936 struct cpufreq_governor *gov = cpufreq_default_governor(); 2937 2938 if (cpufreq_disabled()) --- 13 unchanged lines hidden --- | 2929} 2930EXPORT_SYMBOL_GPL(cpufreq_unregister_driver); 2931 2932static int __init cpufreq_core_init(void) 2933{ 2934 struct cpufreq_governor *gov = cpufreq_default_governor(); 2935 2936 if (cpufreq_disabled()) --- 13 unchanged lines hidden --- |