drivers: Fix mods arm ffa error for kernel 6.2

Updated from ffa_ops to msg_ops for ffa api

Bug 3974855

Change-Id: Ice2ccea2c860f05dbd862a49837eba071d563311
Signed-off-by: Dong Qiang <carld@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2865316
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Dong Qiang
2023-03-01 11:25:45 +00:00
committed by Laxman Dewangan
parent 6f11b7dffb
commit dbced7f181
2 changed files with 12 additions and 4 deletions

View File

@@ -18,11 +18,7 @@ mods-y += mods_mem.o
mods-$(CONFIG_ACPI) += mods_acpi.o
mods-$(CONFIG_TEGRA_NVADSP) += mods_adsp.o
# mods_arm_ffa and mods_bpmpipc are currently broken for Linux v6.2
# and so skip for Linux v6.2+
ifeq ($(shell test $(LINUX_VERSION) -lt $(LINUX_VERSION_6_2); echo $$?),0)
mods-$(CONFIG_ARM_FFA_TRANSPORT) += mods_arm_ffa.o
endif
mods-$(CONFIG_TEGRA_IVC) += mods_bpmpipc.o
mods-$(CONFIG_COMMON_CLK) += mods_clock.o
mods-$(CONFIG_DEBUG_FS) += mods_debugfs.o

View File

@@ -30,7 +30,11 @@ static const struct ffa_device_id mods_ffa_device_id[] = {
struct mods_ffa_ctx {
struct ffa_device *ffa_dev;
#if KERNEL_VERSION(6, 2, 0) <= MODS_KERNEL_VERSION
const struct ffa_msg_ops *ffa_ops;
#else
const struct ffa_dev_ops *ffa_ops;
#endif
};
static struct mods_ffa_ctx mods_ffa_info;
@@ -38,9 +42,17 @@ static struct mods_ffa_ctx mods_ffa_info;
static int ffa_probe(struct ffa_device *ffa_dev)
{
int ret = 0;
#if KERNEL_VERSION(6, 2, 0) <= MODS_KERNEL_VERSION
const struct ffa_msg_ops *ffa_ops = NULL;
if (ffa_dev->ops)
ffa_ops = ffa_dev->ops->msg_ops;
#else
const struct ffa_dev_ops *ffa_ops;
ffa_ops = ffa_dev_ops_get(ffa_dev);
#endif
if (!ffa_ops) {
mods_error_printk("failed \"method\" init: ffa\n");
return -ENOENT;