From bdcb622a25eecd4dd86b3403aaa59eadde1ea2dd Mon Sep 17 00:00:00 2001 From: Anton Moberg Date: Wed, 25 Aug 2021 14:06:24 +0200 Subject: Update amba_driver.remove to comply with v5.12 As of kernel version v5.12 the amba_driver.remove is expected to be of 'static void' rather than the previous 'static int'. This patch updates the mhu files to comply with kernel version v5.12. Change-Id: Iec4d7927e0db2c8008049b743ca890647a2fa9ff --- mailbox/arm_mhu.c | 11 +++++++++++ mailbox/arm_mhu_v2.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/mailbox/arm_mhu.c b/mailbox/arm_mhu.c index 42a8833..102fd44 100644 --- a/mailbox/arm_mhu.c +++ b/mailbox/arm_mhu.c @@ -31,6 +31,7 @@ #include #include #include +#include struct mhu_register_offsets { uint8_t intr_stat_ofs; @@ -223,6 +224,14 @@ static int mhu_probe(struct amba_device *adev, const struct amba_id *id) return 0; } +#if KERNEL_VERSION(5, 12, 0) <= LINUX_VERSION_CODE +static void mhu_remove(struct amba_device *adev) +{ + struct arm_mhu *mhu = amba_get_drvdata(adev); + + mbox_controller_unregister(&mhu->mbox); +} +#else static int mhu_remove(struct amba_device *adev) { struct arm_mhu *mhu = amba_get_drvdata(adev); @@ -231,6 +240,8 @@ static int mhu_remove(struct amba_device *adev) return 0; } +#endif + static struct amba_id mhu_ids[] = { { diff --git a/mailbox/arm_mhu_v2.c b/mailbox/arm_mhu_v2.c index 66ce216..b65bd78 100644 --- a/mailbox/arm_mhu_v2.c +++ b/mailbox/arm_mhu_v2.c @@ -18,6 +18,7 @@ #include #include #include +#include #define MHU_V2_REG_STAT_OFS 0x0 #define MHU_V2_REG_CLR_OFS 0x8 @@ -264,6 +265,14 @@ static int mhuv2_probe(struct amba_device *adev, return 0; } +#if KERNEL_VERSION(5, 12, 0) <= LINUX_VERSION_CODE +static void mhuv2_remove(struct amba_device *adev) +{ + struct arm_mhuv2 *mhuv2 = amba_get_drvdata(adev); + + mbox_controller_unregister(&mhuv2->mbox); +} +#else static int mhuv2_remove(struct amba_device *adev) { struct arm_mhuv2 *mhuv2 = amba_get_drvdata(adev); @@ -272,6 +281,8 @@ static int mhuv2_remove(struct amba_device *adev) return 0; } +#endif + static struct amba_id mhuv2_ids[] = { { -- cgit v1.2.1