aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/qca-nss-dp/patches/0008-switchdev-remove-the-transaction-structure.patch
blob: 220be961ab4a3d4fc7d1e059bce8b7c963c690e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From c9afdcdd2642485a6476906be9da2e811090fc7a Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Fri, 18 Mar 2022 18:06:03 +0100
Subject: [PATCH] switchdev: remove the transaction structure

Since 5.12 there is no transaction structure anymore, so drop it for
5.12 and newer.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
 nss_dp_switchdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/nss_dp_switchdev.c
+++ b/nss_dp_switchdev.c
@@ -279,13 +279,19 @@ void nss_dp_switchdev_setup(struct net_d
  *	Sets attributes
  */
 static int nss_dp_port_attr_set(struct net_device *dev,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
 				const struct switchdev_attr *attr,
 				struct switchdev_trans *trans)
+#else
+				const struct switchdev_attr *attr)
+#endif
 {
 	struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(dev);
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
 	if (switchdev_trans_ph_prepare(trans))
 		return 0;
+#endif
 
 	switch (attr->id) {
 	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
@@ -309,8 +315,12 @@ static int nss_dp_switchdev_port_attr_se
 {
 	int err;
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
 	err = nss_dp_port_attr_set(netdev, port_attr_info->attr,
 				   port_attr_info->trans);
+#else
+	err = nss_dp_port_attr_set(netdev, port_attr_info->attr);
+#endif
 
 	port_attr_info->handled = true;
 	return notifier_from_errno(err);