summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc/remoteproc_cdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/remoteproc/remoteproc_cdev.c')
-rw-r--r--drivers/remoteproc/remoteproc_cdev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_cdev.c b/drivers/remoteproc/remoteproc_cdev.c
index 0249d8f6c3f8..2db494816d5f 100644
--- a/drivers/remoteproc/remoteproc_cdev.c
+++ b/drivers/remoteproc/remoteproc_cdev.c
@@ -43,6 +43,11 @@ static ssize_t rproc_cdev_write(struct file *filp, const char __user *buf, size_
return -EINVAL;
rproc_shutdown(rproc);
+ } else if (!strncmp(cmd, "detach", len)) {
+ if (rproc->state != RPROC_ATTACHED)
+ return -EINVAL;
+
+ ret = rproc_detach(rproc);
} else {
dev_err(&rproc->dev, "Unrecognized option\n");
ret = -EINVAL;