sysfs.c (e752ab11dcb48353727ea26eefd740155e028865) | sysfs.c (bf6479dbe743ca343fa122aaffbe9dcb1de80a51) |
---|---|
1/* 2 * sysfs.c - sysfs support 3 * 4 * (C) 2006-2007 Shaohua Li <shaohua.li@intel.com> 5 * 6 * This code is licenced under the GPL. 7 */ 8 --- 105 unchanged lines hidden (view full) --- 114 115static struct attribute_group cpuidle_attr_group = { 116 .attrs = cpuidle_attrs, 117 .name = "cpuidle", 118}; 119 120/** 121 * cpuidle_add_interface - add CPU global sysfs attributes | 1/* 2 * sysfs.c - sysfs support 3 * 4 * (C) 2006-2007 Shaohua Li <shaohua.li@intel.com> 5 * 6 * This code is licenced under the GPL. 7 */ 8 --- 105 unchanged lines hidden (view full) --- 114 115static struct attribute_group cpuidle_attr_group = { 116 .attrs = cpuidle_attrs, 117 .name = "cpuidle", 118}; 119 120/** 121 * cpuidle_add_interface - add CPU global sysfs attributes |
122 * @dev: the target device | |
123 */ | 122 */ |
124int cpuidle_add_interface(struct device *dev) | 123int cpuidle_add_interface(void) |
125{ | 124{ |
126 return sysfs_create_group(&dev->kobj, &cpuidle_attr_group); | 125 struct device *dev_root = bus_get_dev_root(&cpu_subsys); 126 int retval; 127 128 if (!dev_root) 129 return -EINVAL; 130 131 retval = sysfs_create_group(&dev_root->kobj, &cpuidle_attr_group); 132 put_device(dev_root); 133 return retval; |
127} 128 129/** 130 * cpuidle_remove_interface - remove CPU global sysfs attributes 131 * @dev: the target device 132 */ 133void cpuidle_remove_interface(struct device *dev) 134{ --- 606 unchanged lines hidden --- | 134} 135 136/** 137 * cpuidle_remove_interface - remove CPU global sysfs attributes 138 * @dev: the target device 139 */ 140void cpuidle_remove_interface(struct device *dev) 141{ --- 606 unchanged lines hidden --- |