All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] optee: don't fail on unsuccessful device enumeration
@ 2020-05-13  0:34 Volodymyr Babchuk
  2020-05-13  0:36 ` Volodymyr Babchuk
  0 siblings, 1 reply; 10+ messages in thread
From: Volodymyr Babchuk @ 2020-05-13  0:34 UTC (permalink / raw)
  To: Jens Wiklander, open list; +Cc: Volodymyr Babchuk, Volodymyr Babchuk

optee_enumerate_devices() can fail for multiple of reasons. For
example, I encountered issue when Xen OP-TEE mediator NACKed
PTA_CMD_GET_DEVICES call. This should not result in driver
initialization error because this is an optional feature.

Thus, it is better to print warning, instead of termination driver
initialization.

Signed-off-by: Volodymyr Babchuk <vlad.babcuk@gmail.com>
---
 drivers/tee/optee/core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
index 34409c916882..a053930032f2 100644
--- a/drivers/tee/optee/core.c
+++ b/drivers/tee/optee/core.c
@@ -728,10 +728,8 @@ static int __init optee_driver_init(void)
 		return PTR_ERR(optee);
 
 	rc = optee_enumerate_devices();
-	if (rc) {
-		optee_remove(optee);
-		return rc;
-	}
+	if (rc)
+		pr_warn("can't enumerate optee devices: %d\n", rc);
 
 	pr_info("initialized driver\n");
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-18 12:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13  0:34 [PATCH] optee: don't fail on unsuccessful device enumeration Volodymyr Babchuk
2020-05-13  0:36 ` Volodymyr Babchuk
2020-05-13  8:00   ` Jens Wiklander
2020-05-13  8:23     ` Sumit Garg
2020-05-14  1:18       ` Volodymyr Babchuk
2020-05-14  5:38         ` Sumit Garg
2020-05-15  1:01           ` Volodymyr Babchuk
2020-05-15  4:54             ` Sumit Garg
2020-05-18 10:27               ` Volodymyr Babchuk
2020-05-18 12:34                 ` Sumit Garg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.