summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2022-06-06 13:31:46 +0200
committernorly <ny-git@enpas.org>2022-06-06 13:33:58 +0200
commitcb39fc240dcef350a237651ff4dee20f2bcf96e3 (patch)
tree3985a074c6a368fbf8c1faf65367a3aa56504ce7
parent220768ed383892a91e710cc174f4023bc59dafbf (diff)
Fix compilation on Linux up to v5.4
mailbox_read()'s type signature was changed in 4e9c9484b085 which is upstream since v5.5.
-rw-r--r--module/can327.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/module/can327.c b/module/can327.c
index 833171c..fc99dea 100644
--- a/module/can327.c
+++ b/module/can327.c
@@ -762,6 +762,16 @@ static void elm327_parse_rxbuf(struct can327 *elm, size_t first_new_char_idx)
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
/* Dummy needed to use can_rx_offload */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+static unsigned int *can327_mailbox_read(struct can_rx_offload *offload,
+ struct can_frame *cf,
+ u32 *timestamp, unsigned int n)
+{
+ WARN_ON_ONCE(1); /* This function is a dummy, so don't call it! */
+
+ return -ENOBUFS;
+}
+#else /* Since 4e9c9484b085 (included in v5.5) */
static struct sk_buff *can327_mailbox_read(struct can_rx_offload *offload,
unsigned int n, u32 *timestamp,
bool drop)
@@ -771,6 +781,7 @@ static struct sk_buff *can327_mailbox_read(struct can_rx_offload *offload,
return ERR_PTR(-ENOBUFS);
}
#endif
+#endif
static int can327_netdev_open(struct net_device *dev)
{