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()
75 ret = parent_create_sysfs_files(parent); in mdev_register_parent()
93 void mdev_unregister_parent(struct mdev_parent *parent) in mdev_unregister_parent() argument
98 dev_info(parent->dev, "MDEV: Unregistering\n"); in mdev_unregister_parent()
100 down_write(&parent->unreg_sem); in mdev_unregister_parent()
101 class_compat_remove_link(mdev_bus_compat_class, parent->dev, NULL); in mdev_unregister_parent()
102 device_for_each_child(parent->dev, NULL, mdev_device_remove_cb); in mdev_unregister_parent()
103 parent_remove_sysfs_files(parent); in mdev_unregister_parent()
104 up_write(&parent->unreg_sem); in mdev_unregister_parent()
106 kobject_uevent_env(&parent->dev->kobj, KOBJ_CHANGE, envp); in mdev_unregister_parent()
113 struct mdev_parent *parent = mdev->type->parent; in mdev_device_release() local
117 if (!parent->mdev_driver->get_available) in mdev_device_release()
118 atomic_inc(&parent->available_instances); in mdev_device_release()
132 struct mdev_parent *parent = type->parent; in mdev_device_create() local
133 struct mdev_driver *drv = parent->mdev_driver; in mdev_device_create()
150 if (!atomic_read(&parent->available_instances)) { in mdev_device_create()
154 atomic_dec(&parent->available_instances); in mdev_device_create()
164 mdev->dev.parent = parent->dev; in mdev_device_create()
181 if (!down_read_trylock(&parent->unreg_sem)) { in mdev_device_create()
200 up_read(&parent->unreg_sem); in mdev_device_create()
207 up_read(&parent->unreg_sem); in mdev_device_create()
216 struct mdev_parent *parent = mdev->type->parent; in mdev_device_remove() local
238 if (!down_read_trylock(&parent->unreg_sem)) in mdev_device_remove()
242 up_read(&parent->unreg_sem); in mdev_device_remove()