mtty_dev 77 samples/vfio-mdev/mtty.c } mtty_dev; mtty_dev 1415 samples/vfio-mdev/mtty.c memset(&mtty_dev, 0, sizeof(mtty_dev)); mtty_dev 1417 samples/vfio-mdev/mtty.c idr_init(&mtty_dev.vd_idr); mtty_dev 1419 samples/vfio-mdev/mtty.c ret = alloc_chrdev_region(&mtty_dev.vd_devt, 0, MINORMASK + 1, mtty_dev 1427 samples/vfio-mdev/mtty.c cdev_init(&mtty_dev.vd_cdev, &vd_fops); mtty_dev 1428 samples/vfio-mdev/mtty.c cdev_add(&mtty_dev.vd_cdev, mtty_dev.vd_devt, MINORMASK + 1); mtty_dev 1430 samples/vfio-mdev/mtty.c pr_info("major_number:%d\n", MAJOR(mtty_dev.vd_devt)); mtty_dev 1432 samples/vfio-mdev/mtty.c mtty_dev.vd_class = class_create(THIS_MODULE, MTTY_CLASS_NAME); mtty_dev 1434 samples/vfio-mdev/mtty.c if (IS_ERR(mtty_dev.vd_class)) { mtty_dev 1436 samples/vfio-mdev/mtty.c ret = PTR_ERR(mtty_dev.vd_class); mtty_dev 1440 samples/vfio-mdev/mtty.c mtty_dev.dev.class = mtty_dev.vd_class; mtty_dev 1441 samples/vfio-mdev/mtty.c mtty_dev.dev.release = mtty_device_release; mtty_dev 1442 samples/vfio-mdev/mtty.c dev_set_name(&mtty_dev.dev, "%s", MTTY_NAME); mtty_dev 1444 samples/vfio-mdev/mtty.c ret = device_register(&mtty_dev.dev); mtty_dev 1448 samples/vfio-mdev/mtty.c ret = mdev_register_device(&mtty_dev.dev, &mdev_fops); mtty_dev 1459 samples/vfio-mdev/mtty.c device_unregister(&mtty_dev.dev); mtty_dev 1461 samples/vfio-mdev/mtty.c class_destroy(mtty_dev.vd_class); mtty_dev 1464 samples/vfio-mdev/mtty.c cdev_del(&mtty_dev.vd_cdev); mtty_dev 1465 samples/vfio-mdev/mtty.c unregister_chrdev_region(mtty_dev.vd_devt, MINORMASK + 1); mtty_dev 1473 samples/vfio-mdev/mtty.c mtty_dev.dev.bus = NULL; mtty_dev 1474 samples/vfio-mdev/mtty.c mdev_unregister_device(&mtty_dev.dev); mtty_dev 1476 samples/vfio-mdev/mtty.c device_unregister(&mtty_dev.dev); mtty_dev 1477 samples/vfio-mdev/mtty.c idr_destroy(&mtty_dev.vd_idr); mtty_dev 1478 samples/vfio-mdev/mtty.c cdev_del(&mtty_dev.vd_cdev); mtty_dev 1479 samples/vfio-mdev/mtty.c unregister_chrdev_region(mtty_dev.vd_devt, MINORMASK + 1); mtty_dev 1480 samples/vfio-mdev/mtty.c class_destroy(mtty_dev.vd_class); mtty_dev 1481 samples/vfio-mdev/mtty.c mtty_dev.vd_class = NULL;