cmd: remoteproc: Allow list command to print the probed devices
authorLokesh Vutla <lokeshvutla@ti.com>
Fri, 7 Jun 2019 13:55:56 +0000 (19:25 +0530)
committerTom Rini <trini@konsulko.com>
Sat, 27 Jul 2019 01:49:24 +0000 (21:49 -0400)
'rproc list' is currently allowed only after probing all the
available remoteproc devices. Given that 'rproc init' is updated
to probe and initialize devices individually, allow the 'rproc list'
command to print all probed devices at any point.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
cmd/remoteproc.c

index 9702cf08f7c82a5051238a8032d0f4c810c35bfe..da6f3fc8ccf1eb03068484520b212202cdc03117 100644 (file)
@@ -34,6 +34,10 @@ static int print_remoteproc_list(void)
 
                uc_pdata = dev_get_uclass_platdata(dev);
 
+               /* Do not print if rproc is not probed */
+               if (!(dev->flags & DM_FLAG_ACTIVATED))
+                       continue;
+
                switch (uc_pdata->mem_type) {
                case RPROC_INTERNAL_MEMORY_MAPPED:
                        type = "internal memory mapped";
@@ -101,11 +105,6 @@ static int do_rproc_init(cmd_tbl_t *cmdtp, int flag, int argc,
 static int do_remoteproc_list(cmd_tbl_t *cmdtp, int flag, int argc,
                              char *const argv[])
 {
-       if (!rproc_is_initialized()) {
-               printf("\t Remote Processors is not initialized\n");
-               return CMD_RET_USAGE;
-       }
-
        if (print_remoteproc_list())
                return CMD_RET_FAILURE;