Merge tag 's390-6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
[linux-block.git] / arch / s390 / kernel / topology.c
index e5d6a1c25d13affa166a53b1402ca47cbfc10fa1..9fd19530c9a5623d5901abb1dd9e2032238203ba 100644 (file)
@@ -639,12 +639,21 @@ static struct ctl_table topology_ctl_table[] = {
 
 static int __init topology_init(void)
 {
+       struct device *dev_root;
+       int rc = 0;
+
        timer_setup(&topology_timer, topology_timer_fn, TIMER_DEFERRABLE);
        if (MACHINE_HAS_TOPOLOGY)
                set_topology_timer();
        else
                topology_update_polarization_simple();
        register_sysctl("s390", topology_ctl_table);
-       return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching);
+
+       dev_root = bus_get_dev_root(&cpu_subsys);
+       if (dev_root) {
+               rc = device_create_file(dev_root, &dev_attr_dispatching);
+               put_device(dev_root);
+       }
+       return rc;
 }
 device_initcall(topology_init);