mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
cpu/hotplug: 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: Thomas Gleixner <tglx@linutronix.de> Cc: Valentin Schneider <vschneid@redhat.com> Cc: Phil Auld <pauld@redhat.com> Cc: Steven Price <steven.price@arm.com> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Vincent Donnefort <vdonnefort@google.com> Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Cc: "Jason A. Donenfeld" <Jason@zx2c4.com> Link: https://lore.kernel.org/r/20230313182918.1312597-7-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
23
kernel/cpu.c
23
kernel/cpu.c
@@ -2569,22 +2569,33 @@ static const struct attribute_group cpuhp_smt_attr_group = {
|
|||||||
|
|
||||||
static int __init cpu_smt_sysfs_init(void)
|
static int __init cpu_smt_sysfs_init(void)
|
||||||
{
|
{
|
||||||
return sysfs_create_group(&cpu_subsys.dev_root->kobj,
|
struct device *dev_root;
|
||||||
&cpuhp_smt_attr_group);
|
int ret = -ENODEV;
|
||||||
|
|
||||||
|
dev_root = bus_get_dev_root(&cpu_subsys);
|
||||||
|
if (dev_root) {
|
||||||
|
ret = sysfs_create_group(&dev_root->kobj, &cpuhp_smt_attr_group);
|
||||||
|
put_device(dev_root);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init cpuhp_sysfs_init(void)
|
static int __init cpuhp_sysfs_init(void)
|
||||||
{
|
{
|
||||||
|
struct device *dev_root;
|
||||||
int cpu, ret;
|
int cpu, ret;
|
||||||
|
|
||||||
ret = cpu_smt_sysfs_init();
|
ret = cpu_smt_sysfs_init();
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = sysfs_create_group(&cpu_subsys.dev_root->kobj,
|
dev_root = bus_get_dev_root(&cpu_subsys);
|
||||||
&cpuhp_cpu_root_attr_group);
|
if (dev_root) {
|
||||||
if (ret)
|
ret = sysfs_create_group(&dev_root->kobj, &cpuhp_cpu_root_attr_group);
|
||||||
return ret;
|
put_device(dev_root);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
for_each_possible_cpu(cpu) {
|
for_each_possible_cpu(cpu) {
|
||||||
struct device *dev = get_cpu_device(cpu);
|
struct device *dev = get_cpu_device(cpu);
|
||||||
|
Reference in New Issue
Block a user