diff options
author | Anton Moberg <anton.moberg@arm.com> | 2021-08-25 14:06:24 +0200 |
---|---|---|
committer | Anton Moberg <anton.moberg@arm.com> | 2021-08-26 15:19:33 +0200 |
commit | bdcb622a25eecd4dd86b3403aaa59eadde1ea2dd (patch) | |
tree | 8f04d32e2ade58f2b9f72ce930bd9f0788954727 | |
parent | ec3f2b014e64c5f4f2e01bfdc8a87721f8279396 (diff) | |
download | ethos-u-linux-driver-stack-bdcb622a25eecd4dd86b3403aaa59eadde1ea2dd.tar.gz |
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
-rw-r--r-- | mailbox/arm_mhu.c | 11 | ||||
-rw-r--r-- | mailbox/arm_mhu_v2.c | 11 |
2 files changed, 22 insertions, 0 deletions
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 <linux/module.h> #include <linux/amba/bus.h> #include <linux/mailbox_controller.h> +#include <linux/version.h> 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 <linux/mailbox_controller.h> #include <linux/of_device.h> #include <linux/of_address.h> +#include <linux/version.h> #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[] = { { |