Lines Matching refs:mdev
27 static void mdev_device_remove_common(struct mdev_device *mdev) in mdev_device_remove_common() argument
29 struct mdev_parent *parent = mdev->type->parent; in mdev_device_remove_common()
31 mdev_remove_sysfs_files(mdev); in mdev_device_remove_common()
32 device_del(&mdev->dev); in mdev_device_remove_common()
35 put_device(&mdev->dev); in mdev_device_remove_common()
112 struct mdev_device *mdev = to_mdev_device(dev); in mdev_device_release() local
113 struct mdev_parent *parent = mdev->type->parent; in mdev_device_release()
116 list_del(&mdev->next); in mdev_device_release()
122 kobject_put(&mdev->type->kobj); in mdev_device_release()
124 dev_dbg(&mdev->dev, "MDEV: destroying\n"); in mdev_device_release()
125 kfree(mdev); in mdev_device_release()
131 struct mdev_device *mdev, *tmp; in mdev_device_create() local
157 mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); in mdev_device_create()
158 if (!mdev) { in mdev_device_create()
163 device_initialize(&mdev->dev); in mdev_device_create()
164 mdev->dev.parent = parent->dev; in mdev_device_create()
165 mdev->dev.bus = &mdev_bus_type; in mdev_device_create()
166 mdev->dev.release = mdev_device_release; in mdev_device_create()
167 mdev->dev.groups = mdev_device_groups; in mdev_device_create()
168 mdev->type = type; in mdev_device_create()
172 guid_copy(&mdev->uuid, uuid); in mdev_device_create()
173 list_add(&mdev->next, &mdev_list); in mdev_device_create()
176 ret = dev_set_name(&mdev->dev, "%pUl", uuid); in mdev_device_create()
186 ret = device_add(&mdev->dev); in mdev_device_create()
190 ret = device_driver_attach(&drv->driver, &mdev->dev); in mdev_device_create()
194 ret = mdev_create_sysfs_files(mdev); in mdev_device_create()
198 mdev->active = true; in mdev_device_create()
199 dev_dbg(&mdev->dev, "MDEV: created\n"); in mdev_device_create()
205 device_del(&mdev->dev); in mdev_device_create()
209 put_device(&mdev->dev); in mdev_device_create()
213 int mdev_device_remove(struct mdev_device *mdev) in mdev_device_remove() argument
216 struct mdev_parent *parent = mdev->type->parent; in mdev_device_remove()
220 if (tmp == mdev) in mdev_device_remove()
224 if (tmp != mdev) { in mdev_device_remove()
229 if (!mdev->active) { in mdev_device_remove()
234 mdev->active = false; in mdev_device_remove()
241 mdev_device_remove_common(mdev); in mdev_device_remove()