Skip to contentSkip to conversation

drivers: optee: fix i2c build issue

PATCH In review Jorge Ramirez-Ortiz 2 participants 2 messages Aug 31, 2020 – Sep 1, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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)

---
v2: uses IS_REACHABLE instead of macro combination

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, 1 insertion(+), 1 deletion(-)
drivers/tee/optee/rpc.c +1 -1
index 64a206c56264..1e3614e4798f 100644
@@ -50,7 +50,7 @@ static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg)
 	arg->ret = TEEC_ERROR_BAD_PARAMETERS;
 }
 
-#if IS_ENABLED(CONFIG_I2C)
+#if IS_REACHABLE(CONFIG_I2C)
 static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
 					     struct optee_msg_arg *arg)
 {
Signature · 1 line
2.17.1
#1 lore raw
Quoted 13 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)

Quoted 9 lines

---
v2: uses IS_REACHABLE instead of macro combination

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, 1 insertion(+), 1 deletion(-)

Thanks for the prompt fix, I'm picking this up.

Cheers,
Jens