Lines Matching full:rproc
23 struct rproc *rproc = container_of(filp->f_inode->i_cdev, struct rproc, cdev); in rproc_cdev_write() local
35 ret = rproc_boot(rproc); in rproc_cdev_write()
37 ret = rproc_shutdown(rproc); in rproc_cdev_write()
39 ret = rproc_detach(rproc); in rproc_cdev_write()
41 dev_err(&rproc->dev, "Unrecognized option\n"); in rproc_cdev_write()
50 struct rproc *rproc = container_of(filp->f_inode->i_cdev, struct rproc, cdev); in rproc_device_ioctl() local
59 rproc->cdev_put_on_release = !!param; in rproc_device_ioctl()
62 param = (s32)rproc->cdev_put_on_release; in rproc_device_ioctl()
68 dev_err(&rproc->dev, "Unsupported ioctl\n"); in rproc_device_ioctl()
77 struct rproc *rproc = container_of(inode->i_cdev, struct rproc, cdev); in rproc_cdev_release() local
80 if (!rproc->cdev_put_on_release) in rproc_cdev_release()
83 if (rproc->state == RPROC_RUNNING) in rproc_cdev_release()
84 rproc_shutdown(rproc); in rproc_cdev_release()
85 else if (rproc->state == RPROC_ATTACHED) in rproc_cdev_release()
86 ret = rproc_detach(rproc); in rproc_cdev_release()
98 int rproc_char_device_add(struct rproc *rproc) in rproc_char_device_add() argument
102 cdev_init(&rproc->cdev, &rproc_fops); in rproc_char_device_add()
103 rproc->cdev.owner = THIS_MODULE; in rproc_char_device_add()
105 rproc->dev.devt = MKDEV(MAJOR(rproc_major), rproc->index); in rproc_char_device_add()
106 cdev_set_parent(&rproc->cdev, &rproc->dev.kobj); in rproc_char_device_add()
107 ret = cdev_add(&rproc->cdev, rproc->dev.devt, 1); in rproc_char_device_add()
109 dev_err(&rproc->dev, "Failed to add char dev for %s\n", rproc->name); in rproc_char_device_add()
114 void rproc_char_device_remove(struct rproc *rproc) in rproc_char_device_remove() argument
116 cdev_del(&rproc->cdev); in rproc_char_device_remove()