diff mbox series

[U-Boot,v2,2/5] cmd: remoteproc: Allow list command to print the probed devices

Message ID 20190607135559.3671-3-lokeshvutla@ti.com
State Accepted
Commit 96f41f9cde17373680a652e39c8521fcf0a9722f
Delegated to: Tom Rini
Headers show
Series remoteproc: cleanup k3_rpoc driver | expand

Commit Message

Lokesh Vutla June 7, 2019, 1:55 p.m. UTC
'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 | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Tom Rini July 28, 2019, 9:46 p.m. UTC | #1
On Fri, Jun 07, 2019 at 07:25:56PM +0530, Lokesh Vutla wrote:

> '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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/cmd/remoteproc.c b/cmd/remoteproc.c
index 9702cf08f7..da6f3fc8cc 100644
--- a/cmd/remoteproc.c
+++ b/cmd/remoteproc.c
@@ -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;