drivers: optee: fix i2c build issue
Subsystems (2)
PATCH 1/1 drivers: optee: fix i2c build issue
When the optee driver is compiled into the kernel while the i2c core is configured as a module, the i2c symbols are not available.
This commit addresses the situation by disabling the i2c support for this use case while allowing it in all other scenarios:
i2c=y, optee=y
i2c=m, optee=m
i2c=y, optee=m
i2c=m, optee=y (not supported)
---
This patch applies on top of
https://git.linaro.org/people/jens.wiklander/linux-tee.git/tag/?h=optee-i2c-for-v5.10
drivers/tee/optee/rpc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/tee/optee/rpc.c +2 -0
@@ -51,6 +51,7 @@ static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg) } #if IS_ENABLED(CONFIG_I2C) +#if !defined(CONFIG_I2C_MODULE) || defined(CONFIG_OPTEE_MODULE) static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx, struct optee_msg_arg *arg) {
@@ -140,6 +141,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx, arg->ret =TEEC_ERROR_NOT_SUPPORTED ; }#endif +#endif static struct wq_entry *wq_entry_get (struct optee_wait_queue *wq,u32 key) {
Signature · 1 line
2.17.1
Quoted 26 lines · Jorge Ramirez-Ortiz
When the optee driver is compiled into the kernel while the i2c core is configured as a module, the i2c symbols are not available.
This commit addresses the situation by disabling the i2c support for this use case while allowing it in all other scenarios:
i2c=y, optee=y
i2c=m, optee=m
i2c=y, optee=m
i2c=m, optee=y (not supported)Reported-by kernel test robot <[email protected]>Signed-off-by Jorge Ramirez-Ortiz <[email protected]>---
This patch applies on top of
https://git.linaro.org/people/jens.wiklander/linux-tee.git/tag/?h=optee-i2c-for-v5.10drivers/tee/optee/rpc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/tee/optee/rpc.c +0
-0
drivers/tee/optee/rpc.c static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg) · line 54
Quoted 4 lines
drivers/tee/optee/rpc.c +1
-0@@ -51,6 +51,7 @@ static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg) }#if IS_ENABLED (CONFIG_I2C ) +#if !defined(CONFIG_I2C_MODULE ) || defined(CONFIG_OPTEE_MODULE )
Looks like
#if IS_REACHABLE(CONFIG_I2C)
should work here.
Quoted 12 lines
drivers/tee/optee/rpc.c +1
-0static void handle_rpc_func_cmd_i2c_transfer (struct tee_context *ctx,struct optee_msg_arg *arg) {@@ -140,6 +141,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx, arg->ret =TEEC_ERROR_NOT_SUPPORTED ; }#endif +#endif static struct wq_entry *wq_entry_get (struct optee_wait_queue *wq,u32 key) {
Signature · 1 line
~Randy
Quoted 29 lines · Randy Dunlap
Quoted 28 lines · Jorge Ramirez-Ortiz
When the optee driver is compiled into the kernel while the i2c core is configured as a module, the i2c symbols are not available.
This commit addresses the situation by disabling the i2c support for this use case while allowing it in all other scenarios:
i2c=y, optee=y
i2c=m, optee=m
i2c=y, optee=m
i2c=m, optee=y (not supported)Reported-by kernel test robot <[email protected]>Signed-off-by Jorge Ramirez-Ortiz <[email protected]>---
This patch applies on top of
https://git.linaro.org/people/jens.wiklander/linux-tee.git/tag/?h=optee-i2c-for-v5.10drivers/tee/optee/rpc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/tee/optee/rpc.c +0
-0@@ -51,6 +51,7 @@ static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg) }
Quoted 7 lines
drivers/tee/optee/rpc.c static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg) · line 54
Quoted 2 lines
drivers/tee/optee/rpc.c +1
-0#if IS_ENABLED (CONFIG_I2C ) +#if !defined(CONFIG_I2C_MODULE ) || defined(CONFIG_OPTEE_MODULE )Looks like
#ifIS_REACHABLE(CONFIG_I2C)should work here.
yep, much nicer. will do that instead.
Quoted 18 lines
Quoted 13 lines
drivers/tee/optee/rpc.c +1
-0static void handle_rpc_func_cmd_i2c_transfer (struct tee_context *ctx,struct optee_msg_arg *arg) {@@ -140,6 +141,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx, arg->ret =TEEC_ERROR_NOT_SUPPORTED ; }#endif +#endif static struct wq_entry *wq_entry_get (struct optee_wait_queue *wq,u32 key) {Signature · 1 line
~Randy