lkml.org 
[lkml]   [2020]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] optee: don't fail on unsuccessful device enumeration
Date
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
\
 
 \ /
  Last update: 2020-05-13 02:34    [W:0.634 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site