mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 18:36:00 +00:00
cpufreq: move to use bus_get_dev_root()
Direct access to the struct bus_type dev_root pointer is going away soon so replace that with a call to bus_get_dev_root() instead, which is what it is there for. Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Len Brown <lenb@kernel.org> Cc: linux-pm@vger.kernel.org Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/20230313182918.1312597-3-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
34320745df
commit
2744a63c1a
@ -2932,11 +2932,16 @@ EXPORT_SYMBOL_GPL(cpufreq_unregister_driver);
|
||||
static int __init cpufreq_core_init(void)
|
||||
{
|
||||
struct cpufreq_governor *gov = cpufreq_default_governor();
|
||||
struct device *dev_root;
|
||||
|
||||
if (cpufreq_disabled())
|
||||
return -ENODEV;
|
||||
|
||||
cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj);
|
||||
dev_root = bus_get_dev_root(&cpu_subsys);
|
||||
if (dev_root) {
|
||||
cpufreq_global_kobject = kobject_create_and_add("cpufreq", &dev_root->kobj);
|
||||
put_device(dev_root);
|
||||
}
|
||||
BUG_ON(!cpufreq_global_kobject);
|
||||
|
||||
if (!strlen(default_governor))
|
||||
|
@ -1473,10 +1473,13 @@ static struct kobject *intel_pstate_kobject;
|
||||
|
||||
static void __init intel_pstate_sysfs_expose_params(void)
|
||||
{
|
||||
struct device *dev_root = bus_get_dev_root(&cpu_subsys);
|
||||
int rc;
|
||||
|
||||
intel_pstate_kobject = kobject_create_and_add("intel_pstate",
|
||||
&cpu_subsys.dev_root->kobj);
|
||||
if (dev_root) {
|
||||
intel_pstate_kobject = kobject_create_and_add("intel_pstate", &dev_root->kobj);
|
||||
put_device(dev_root);
|
||||
}
|
||||
if (WARN_ON(!intel_pstate_kobject))
|
||||
return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user