diff --git a/drivers/misc/mods/Makefile b/drivers/misc/mods/Makefile index bf620452..8b9a22bf 100644 --- a/drivers/misc/mods/Makefile +++ b/drivers/misc/mods/Makefile @@ -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 diff --git a/drivers/misc/mods/mods_arm_ffa.c b/drivers/misc/mods/mods_arm_ffa.c index 2c8ff336..64178c6b 100644 --- a/drivers/misc/mods/mods_arm_ffa.c +++ b/drivers/misc/mods/mods_arm_ffa.c @@ -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;