Lines Matching refs:kobj

162 	struct kobject *kobj;  in kobject_create()  local
164 kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); in kobject_create()
165 if (kobj == NULL) in kobject_create()
167 kobject_init(kobj, &linux_kfree_type); in kobject_create()
169 return (kobj); in kobject_create()
174 kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) in kobject_set_name_vargs() argument
182 old = kobj->name; in kobject_set_name_vargs()
204 kobj->name = name; in kobject_set_name_vargs()
217 kobject_set_name(struct kobject *kobj, const char *fmt, ...) in kobject_set_name() argument
223 error = kobject_set_name_vargs(kobj, fmt, args); in kobject_set_name()
230 kobject_add_complete(struct kobject *kobj, struct kobject *parent) in kobject_add_complete() argument
235 kobj->parent = parent; in kobject_add_complete()
236 error = sysfs_create_dir(kobj); in kobject_add_complete()
237 if (error == 0 && kobj->ktype && kobj->ktype->default_attrs) { in kobject_add_complete()
239 t = kobj->ktype; in kobject_add_complete()
242 error = sysfs_create_file(kobj, *attr); in kobject_add_complete()
247 sysfs_remove_dir(kobj); in kobject_add_complete()
253 kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...) in kobject_add() argument
259 error = kobject_set_name_vargs(kobj, fmt, args); in kobject_add()
264 return kobject_add_complete(kobj, parent); in kobject_add()
270 struct kobject *kobj; in linux_kobject_release() local
273 kobj = container_of(kref, struct kobject, kref); in linux_kobject_release()
274 sysfs_remove_dir(kobj); in linux_kobject_release()
275 name = kobj->name; in linux_kobject_release()
276 if (kobj->ktype && kobj->ktype->release) in linux_kobject_release()
277 kobj->ktype->release(kobj); in linux_kobject_release()
282 linux_kobject_kfree(struct kobject *kobj) in linux_kobject_kfree() argument
284 kfree(kobj); in linux_kobject_kfree()
288 linux_kobject_kfree_name(struct kobject *kobj) in linux_kobject_kfree_name() argument
290 if (kobj) { in linux_kobject_kfree_name()
291 kfree(kobj->name); in linux_kobject_kfree_name()
300 lkpi_kobj_attr_show(struct kobject *kobj, struct attribute *attr, char *buf) in lkpi_kobj_attr_show() argument
308 return (ka->show(kobj, ka, buf)); in lkpi_kobj_attr_show()
312 lkpi_kobj_attr_store(struct kobject *kobj, struct attribute *attr, in lkpi_kobj_attr_store() argument
321 return (ka->store(kobj, ka, buf, count)); in lkpi_kobj_attr_store()
337 linux_class_show(struct kobject *kobj, struct attribute *attr, char *buf) in linux_class_show() argument
345 error = dattr->show(container_of(kobj, struct class, kobj), in linux_class_show()
351 linux_class_store(struct kobject *kobj, struct attribute *attr, const char *buf, in linux_class_store() argument
360 error = dattr->store(container_of(kobj, struct class, kobj), in linux_class_store()
366 linux_class_release(struct kobject *kobj) in linux_class_release() argument
370 class = container_of(kobj, struct class, kobj); in linux_class_release()
386 linux_dev_release(struct kobject *kobj) in linux_dev_release() argument
390 dev = container_of(kobj, struct device, kobj); in linux_dev_release()
399 linux_dev_show(struct kobject *kobj, struct attribute *attr, char *buf) in linux_dev_show() argument
407 error = dattr->show(container_of(kobj, struct device, kobj), in linux_dev_show()
413 linux_dev_store(struct kobject *kobj, struct attribute *attr, const char *buf, in linux_dev_store() argument
422 error = dattr->store(container_of(kobj, struct device, kobj), in linux_dev_store()
451 kobject_set_name_vargs(&dev->kobj, fmt, args); in device_create()
484 retval = kobject_set_name_vargs(&dev->kobj, fmt, args); in device_create_groups_vargs()
519 kobject_init_and_add(struct kobject *kobj, const struct kobj_type *ktype, in kobject_init_and_add() argument
525 kobject_init(kobj, ktype); in kobject_init_and_add()
526 kobj->ktype = ktype; in kobject_init_and_add()
527 kobj->parent = parent; in kobject_init_and_add()
528 kobj->name = NULL; in kobject_init_and_add()
531 error = kobject_set_name_vargs(kobj, fmt, args); in kobject_init_and_add()
535 return kobject_add_complete(kobj, parent); in kobject_init_and_add()
611 kobject_init(&cdev->kobj, &linux_cdev_ktype); in cdev_alloc()
855 if (ldev->kobj.ktype == &linux_cdev_static_ktype) { in linux_get_fop()
880 if (ldev->kobj.ktype == &linux_cdev_static_ktype) { in linux_drop_fop()
883 MPASS(ldev->kobj.ktype == &linux_cdev_ktype); in linux_drop_fop()
2350 ldev->kobj.ktype == &linux_cdev_ktype) in linux_cdev_deref()
2355 linux_cdev_release(struct kobject *kobj) in linux_cdev_release() argument
2360 cdev = container_of(kobj, struct linux_cdev, kobj); in linux_cdev_release()
2361 parent = kobj->parent; in linux_cdev_release()
2368 linux_cdev_static_release(struct kobject *kobj) in linux_cdev_static_release() argument
2373 ldev = container_of(kobj, struct linux_cdev, kobj); in linux_cdev_static_release()
2379 kobject_put(kobj->parent); in linux_cdev_static_release()
2389 ldev->kobj.parent = &dev->kobj; in linux_cdev_device_add()
2396 if (ldev->kobj.name == NULL) in linux_cdev_device_add()
2426 MPASS(ldev->kobj.ktype == &linux_cdev_ktype); in linux_destroy_dev()
2635 strcmp(kobject_name(&ldev->kobj), name) == 0) { in linux_find_cdev()
2656 kobject_set_name(&cdev->kobj, name); in __register_chrdev()
2678 kobject_set_name(&cdev->kobj, name); in __register_chrdev_p()
2753 kobject_init(&linux_root_device.kobj, &linux_dev_ktype); in linux_compat_init()
2754 kobject_set_name(&linux_root_device.kobj, "device"); in linux_compat_init()
2755 linux_root_device.kobj.oidp = SYSCTL_ADD_NODE(NULL, in linux_compat_init()
2778 linux_kobject_kfree_name(&linux_root_device.kobj); in linux_compat_uninit()
2779 linux_kobject_kfree_name(&linux_class_misc.kobj); in linux_compat_uninit()