misc: mods: Fix build when OPTEE is a module

If the Linux kernel driver OPTEE is built as a module (CONFIG_OPTEE=m)
then building the MODS driver for Tegra fails with the following error
...

 drivers/misc/mods/mods_optee.c:22:5:
 error: no previous prototype for 'esc_mods_invoke_optee_ta'
 [-Werror=missing-prototypes]
   22 | int esc_mods_invoke_optee_ta(struct mods_client *client,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~

The problem is in the mods_internal.h file that wraps the prototype for
the above function with '#ifdef CONFIG_OPTEE'. This works fine for when
CONFIG_OPTEE=y but not if CONFIG_OPTEE=m. To ensure that this prototype
is present when the OPTEE driver is built into the kernel or a module,
we need to use '#if IS_ENABLED(CONFIG_OPTEE)'. Update the MODS driver
accordingly to fix this.

Bug 4429280

Change-Id: I48054f60cf26c04d2cacff8d8affc46254020aff
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3038965
(cherry picked from commit 0bd71e49bd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055962
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-12-20 15:09:21 +00:00
committed by mobile promotions
parent 176a1bff8d
commit 7635873f3d

View File

@@ -670,7 +670,7 @@ int esc_mods_send_trustzone_msg(struct mods_client *client,
struct MODS_TZ_PARAMS *p);
#endif
#ifdef CONFIG_OPTEE
#if IS_ENABLED(CONFIG_OPTEE)
/* OP-TEE TA call */
int esc_mods_invoke_optee_ta(struct mods_client *client,
struct MODS_OPTEE_PARAMS *p);