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()
118 struct mdev_device *mdev = to_mdev_device(dev); in mdev_device_release() local
119 struct mdev_parent *parent = mdev->type->parent; in mdev_device_release()
122 list_del(&mdev->next); in mdev_device_release()
128 kobject_put(&mdev->type->kobj); in mdev_device_release()
130 dev_dbg(&mdev->dev, "MDEV: destroying\n"); in mdev_device_release()
131 kfree(mdev); in mdev_device_release()
137 struct mdev_device *mdev, *tmp; in mdev_device_create() local
163 mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); in mdev_device_create()
164 if (!mdev) { in mdev_device_create()
169 device_initialize(&mdev->dev); in mdev_device_create()
170 mdev->dev.parent = parent->dev; in mdev_device_create()
171 mdev->dev.bus = &mdev_bus_type; in mdev_device_create()
172 mdev->dev.release = mdev_device_release; in mdev_device_create()
173 mdev->dev.groups = mdev_device_groups; in mdev_device_create()
174 mdev->type = type; in mdev_device_create()
178 guid_copy(&mdev->uuid, uuid); in mdev_device_create()
179 list_add(&mdev->next, &mdev_list); in mdev_device_create()
182 ret = dev_set_name(&mdev->dev, "%pUl", uuid); in mdev_device_create()
192 ret = device_add(&mdev->dev); in mdev_device_create()
196 ret = device_driver_attach(&drv->driver, &mdev->dev); in mdev_device_create()
200 ret = mdev_create_sysfs_files(mdev); in mdev_device_create()
204 mdev->active = true; in mdev_device_create()
205 dev_dbg(&mdev->dev, "MDEV: created\n"); in mdev_device_create()
211 device_del(&mdev->dev); in mdev_device_create()
215 put_device(&mdev->dev); in mdev_device_create()
219 int mdev_device_remove(struct mdev_device *mdev) in mdev_device_remove() argument
222 struct mdev_parent *parent = mdev->type->parent; in mdev_device_remove()
226 if (tmp == mdev) in mdev_device_remove()
230 if (tmp != mdev) { in mdev_device_remove()
235 if (!mdev->active) { in mdev_device_remove()
240 mdev->active = false; in mdev_device_remove()
247 mdev_device_remove_common(mdev); in mdev_device_remove()