Lines Matching refs:kobj
151 return sysfs_create_group(&dev->kobj, &cpuidle_attr_group); in cpuidle_add_interface()
159 sysfs_remove_group(&dev->kobj, &cpuidle_attr_group); in cpuidle_remove_interface()
178 struct kobject kobj; member
181 static inline struct cpuidle_device *to_cpuidle_device(struct kobject *kobj) in to_cpuidle_device() argument
184 container_of(kobj, struct cpuidle_device_kobj, kobj); in to_cpuidle_device()
189 static ssize_t cpuidle_show(struct kobject *kobj, struct attribute *attr, in cpuidle_show() argument
193 struct cpuidle_device *dev = to_cpuidle_device(kobj); in cpuidle_show()
204 static ssize_t cpuidle_store(struct kobject *kobj, struct attribute *attr, in cpuidle_store() argument
208 struct cpuidle_device *dev = to_cpuidle_device(kobj); in cpuidle_store()
224 static void cpuidle_sysfs_release(struct kobject *kobj) in cpuidle_sysfs_release() argument
227 container_of(kobj, struct cpuidle_device_kobj, kobj); in cpuidle_sysfs_release()
330 struct kobject kobj; member
333 #define kobj_to_state_obj(k) container_of(k, struct cpuidle_state_kobj, kobj)
338 static ssize_t cpuidle_state_show(struct kobject *kobj, struct attribute *attr, in cpuidle_state_show() argument
342 struct cpuidle_state *state = kobj_to_state(kobj); in cpuidle_state_show()
343 struct cpuidle_state_usage *state_usage = kobj_to_state_usage(kobj); in cpuidle_state_show()
352 static ssize_t cpuidle_state_store(struct kobject *kobj, struct attribute *attr, in cpuidle_state_store() argument
356 struct cpuidle_state *state = kobj_to_state(kobj); in cpuidle_state_store()
357 struct cpuidle_state_usage *state_usage = kobj_to_state_usage(kobj); in cpuidle_state_store()
371 static void cpuidle_state_sysfs_release(struct kobject *kobj) in cpuidle_state_sysfs_release() argument
373 struct cpuidle_state_kobj *state_obj = kobj_to_state_obj(kobj); in cpuidle_state_sysfs_release()
386 kobject_put(&device->kobjs[i]->kobj); in cpuidle_free_state_kobj()
399 struct cpuidle_state_kobj *kobj; in cpuidle_add_state_sysfs() local
405 kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL); in cpuidle_add_state_sysfs()
406 if (!kobj) in cpuidle_add_state_sysfs()
408 kobj->state = &drv->states[i]; in cpuidle_add_state_sysfs()
409 kobj->state_usage = &device->states_usage[i]; in cpuidle_add_state_sysfs()
410 init_completion(&kobj->kobj_unregister); in cpuidle_add_state_sysfs()
412 ret = kobject_init_and_add(&kobj->kobj, &ktype_state_cpuidle, in cpuidle_add_state_sysfs()
413 &kdev->kobj, "state%d", i); in cpuidle_add_state_sysfs()
415 kfree(kobj); in cpuidle_add_state_sysfs()
418 kobject_uevent(&kobj->kobj, KOBJ_ADD); in cpuidle_add_state_sysfs()
419 device->kobjs[i] = kobj; in cpuidle_add_state_sysfs()
444 #define kobj_to_driver_kobj(k) container_of(k, struct cpuidle_driver_kobj, kobj)
454 struct kobject kobj; member
474 static void cpuidle_driver_sysfs_release(struct kobject *kobj) in cpuidle_driver_sysfs_release() argument
476 struct cpuidle_driver_kobj *driver_kobj = kobj_to_driver_kobj(kobj); in cpuidle_driver_sysfs_release()
480 static ssize_t cpuidle_driver_show(struct kobject *kobj, struct attribute *attr, in cpuidle_driver_show() argument
484 struct cpuidle_driver_kobj *driver_kobj = kobj_to_driver_kobj(kobj); in cpuidle_driver_show()
493 static ssize_t cpuidle_driver_store(struct kobject *kobj, struct attribute *attr, in cpuidle_driver_store() argument
497 struct cpuidle_driver_kobj *driver_kobj = kobj_to_driver_kobj(kobj); in cpuidle_driver_store()
542 ret = kobject_init_and_add(&kdrv->kobj, &ktype_driver_cpuidle, in cpuidle_add_driver_sysfs()
543 &kdev->kobj, "driver"); in cpuidle_add_driver_sysfs()
549 kobject_uevent(&kdrv->kobj, KOBJ_ADD); in cpuidle_add_driver_sysfs()
562 kobject_put(&kdrv->kobj); in cpuidle_remove_driver_sysfs()
624 error = kobject_init_and_add(&kdev->kobj, &ktype_cpuidle, &cpu_dev->kobj, in cpuidle_add_sysfs()
631 kobject_uevent(&kdev->kobj, KOBJ_ADD); in cpuidle_add_sysfs()
644 kobject_put(&kdev->kobj); in cpuidle_remove_sysfs()