Lines Matching refs:kobj
146 return sysfs_create_group(&dev->kobj, &cpuidle_attr_group); in cpuidle_add_interface()
154 sysfs_remove_group(&dev->kobj, &cpuidle_attr_group); in cpuidle_remove_interface()
168 #define kobj_to_cpuidledev(k) container_of(k, struct cpuidle_device, kobj)
170 static ssize_t cpuidle_show(struct kobject * kobj, struct attribute * attr ,char * buf) in cpuidle_show() argument
173 struct cpuidle_device *dev = kobj_to_cpuidledev(kobj); in cpuidle_show()
184 static ssize_t cpuidle_store(struct kobject * kobj, struct attribute * attr, in cpuidle_store() argument
188 struct cpuidle_device *dev = kobj_to_cpuidledev(kobj); in cpuidle_store()
204 static void cpuidle_sysfs_release(struct kobject *kobj) in cpuidle_sysfs_release() argument
206 struct cpuidle_device *dev = kobj_to_cpuidledev(kobj); in cpuidle_sysfs_release()
298 #define kobj_to_state_obj(k) container_of(k, struct cpuidle_state_kobj, kobj)
302 static ssize_t cpuidle_state_show(struct kobject * kobj, in cpuidle_state_show() argument
306 struct cpuidle_state *state = kobj_to_state(kobj); in cpuidle_state_show()
307 struct cpuidle_state_usage *state_usage = kobj_to_state_usage(kobj); in cpuidle_state_show()
316 static ssize_t cpuidle_state_store(struct kobject *kobj, in cpuidle_state_store() argument
320 struct cpuidle_state *state = kobj_to_state(kobj); in cpuidle_state_store()
334 static void cpuidle_state_sysfs_release(struct kobject *kobj) in cpuidle_state_sysfs_release() argument
336 struct cpuidle_state_kobj *state_obj = kobj_to_state_obj(kobj); in cpuidle_state_sysfs_release()
349 kobject_put(&device->kobjs[i]->kobj); in cpuidle_free_state_kobj()
362 struct cpuidle_state_kobj *kobj; in cpuidle_add_state_sysfs() local
367 kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL); in cpuidle_add_state_sysfs()
368 if (!kobj) in cpuidle_add_state_sysfs()
370 kobj->state = &drv->states[i]; in cpuidle_add_state_sysfs()
371 kobj->state_usage = &device->states_usage[i]; in cpuidle_add_state_sysfs()
372 init_completion(&kobj->kobj_unregister); in cpuidle_add_state_sysfs()
374 ret = kobject_init_and_add(&kobj->kobj, &ktype_state_cpuidle, &device->kobj, in cpuidle_add_state_sysfs()
377 kfree(kobj); in cpuidle_add_state_sysfs()
380 kobject_uevent(&kobj->kobj, KOBJ_ADD); in cpuidle_add_state_sysfs()
381 device->kobjs[i] = kobj; in cpuidle_add_state_sysfs()
415 error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &cpu_dev->kobj, in cpuidle_add_sysfs()
418 kobject_uevent(&dev->kobj, KOBJ_ADD); in cpuidle_add_sysfs()
432 kobject_put(&dev->kobj); in cpuidle_remove_sysfs()