Lines Matching refs:rproc
23 struct rproc *rproc = container_of(filp->f_inode->i_cdev, struct rproc, cdev); in rproc_cdev_write() local
35 if (rproc->state == RPROC_RUNNING) in rproc_cdev_write()
38 ret = rproc_boot(rproc); in rproc_cdev_write()
40 if (rproc->state != RPROC_RUNNING) in rproc_cdev_write()
43 rproc_shutdown(rproc); in rproc_cdev_write()
45 dev_err(&rproc->dev, "Unrecognized option\n"); in rproc_cdev_write()
54 struct rproc *rproc = container_of(filp->f_inode->i_cdev, struct rproc, cdev); in rproc_device_ioctl() local
63 rproc->cdev_put_on_release = !!param; in rproc_device_ioctl()
66 param = (s32)rproc->cdev_put_on_release; in rproc_device_ioctl()
72 dev_err(&rproc->dev, "Unsupported ioctl\n"); in rproc_device_ioctl()
81 struct rproc *rproc = container_of(inode->i_cdev, struct rproc, cdev); in rproc_cdev_release() local
83 if (rproc->cdev_put_on_release && rproc->state == RPROC_RUNNING) in rproc_cdev_release()
84 rproc_shutdown(rproc); in rproc_cdev_release()
96 int rproc_char_device_add(struct rproc *rproc) in rproc_char_device_add() argument
100 cdev_init(&rproc->cdev, &rproc_fops); in rproc_char_device_add()
101 rproc->cdev.owner = THIS_MODULE; in rproc_char_device_add()
103 rproc->dev.devt = MKDEV(MAJOR(rproc_major), rproc->index); in rproc_char_device_add()
104 cdev_set_parent(&rproc->cdev, &rproc->dev.kobj); in rproc_char_device_add()
105 ret = cdev_add(&rproc->cdev, rproc->dev.devt, 1); in rproc_char_device_add()
107 dev_err(&rproc->dev, "Failed to add char dev for %s\n", rproc->name); in rproc_char_device_add()
112 void rproc_char_device_remove(struct rproc *rproc) in rproc_char_device_remove() argument
114 cdev_del(&rproc->cdev); in rproc_char_device_remove()