Lines Matching refs:parent

29 	struct mdev_parent *parent = mdev->type->parent;  in mdev_device_remove_common()  local
33 lockdep_assert_held(&parent->unreg_sem); in mdev_device_remove_common()
59 int mdev_register_parent(struct mdev_parent *parent, struct device *dev, in mdev_register_parent() argument
67 memset(parent, 0, sizeof(*parent)); in mdev_register_parent()
68 init_rwsem(&parent->unreg_sem); in mdev_register_parent()
69 parent->dev = dev; in mdev_register_parent()
70 parent->mdev_driver = mdev_driver; in mdev_register_parent()
71 parent->types = types; in mdev_register_parent()
72 parent->nr_types = nr_types; in mdev_register_parent()
73 atomic_set(&parent->available_instances, mdev_driver->max_instances); in mdev_register_parent()
81 ret = parent_create_sysfs_files(parent); in mdev_register_parent()
99 void mdev_unregister_parent(struct mdev_parent *parent) in mdev_unregister_parent() argument
104 dev_info(parent->dev, "MDEV: Unregistering\n"); in mdev_unregister_parent()
106 down_write(&parent->unreg_sem); in mdev_unregister_parent()
107 class_compat_remove_link(mdev_bus_compat_class, parent->dev, NULL); in mdev_unregister_parent()
108 device_for_each_child(parent->dev, NULL, mdev_device_remove_cb); in mdev_unregister_parent()
109 parent_remove_sysfs_files(parent); in mdev_unregister_parent()
110 up_write(&parent->unreg_sem); in mdev_unregister_parent()
112 kobject_uevent_env(&parent->dev->kobj, KOBJ_CHANGE, envp); in mdev_unregister_parent()
119 struct mdev_parent *parent = mdev->type->parent; in mdev_device_release() local
123 if (!parent->mdev_driver->get_available) in mdev_device_release()
124 atomic_inc(&parent->available_instances); in mdev_device_release()
138 struct mdev_parent *parent = type->parent; in mdev_device_create() local
139 struct mdev_driver *drv = parent->mdev_driver; in mdev_device_create()
156 if (!atomic_read(&parent->available_instances)) { in mdev_device_create()
160 atomic_dec(&parent->available_instances); in mdev_device_create()
170 mdev->dev.parent = parent->dev; in mdev_device_create()
187 if (!down_read_trylock(&parent->unreg_sem)) { in mdev_device_create()
206 up_read(&parent->unreg_sem); in mdev_device_create()
213 up_read(&parent->unreg_sem); in mdev_device_create()
222 struct mdev_parent *parent = mdev->type->parent; in mdev_device_remove() local
244 if (!down_read_trylock(&parent->unreg_sem)) in mdev_device_remove()
248 up_read(&parent->unreg_sem); in mdev_device_remove()