]> Git Repo - J-linux.git/commitdiff
remoteproc: core: Register the character device interface
authorSiddharth Gupta <[email protected]>
Wed, 29 Jul 2020 17:40:01 +0000 (10:40 -0700)
committerBjorn Andersson <[email protected]>
Wed, 5 Aug 2020 03:17:08 +0000 (20:17 -0700)
Add the character device during rproc_add. This would create
a character device node at /dev/remoteproc<index>. Userspace
applications can interact with the remote processor using this
interface.

Reviewed-by: Bjorn Andersson <[email protected]>
Reviewed-by: Mathieu Poirier <[email protected]>
Signed-off-by: Rishabh Bhatnagar <[email protected]>
Signed-off-by: Siddharth Gupta <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bjorn Andersson <[email protected]>
drivers/remoteproc/remoteproc_core.c

index 277d3bf7a250dc150d9aad77593d3d2023f2bec6..7f90eeea67e279aae5a87a02c8552daadbe33af8 100644 (file)
@@ -1986,6 +1986,11 @@ int rproc_add(struct rproc *rproc)
        /* create debugfs entries */
        rproc_create_debug_dir(rproc);
 
+       /* add char device for this remoteproc */
+       ret = rproc_char_device_add(rproc);
+       if (ret < 0)
+               return ret;
+
        /*
         * Remind ourselves the remote processor has been attached to rather
         * than booted by the remoteproc core.  This is important because the
@@ -2262,6 +2267,7 @@ int rproc_del(struct rproc *rproc)
        mutex_unlock(&rproc->lock);
 
        rproc_delete_debug_dir(rproc);
+       rproc_char_device_remove(rproc);
 
        /* the rproc is downref'ed as soon as it's removed from the klist */
        mutex_lock(&rproc_list_mutex);
@@ -2430,6 +2436,7 @@ static int __init remoteproc_init(void)
 {
        rproc_init_sysfs();
        rproc_init_debugfs();
+       rproc_init_cdev();
        rproc_init_panic();
 
        return 0;
This page took 0.052112 seconds and 4 git commands to generate.