kernel: qca-ssdk: update to 12.4.5.r1
[openwrt/staging/jow.git] / package / kernel / qca-nss-dp / patches / 0008-switchdev-remove-the-transaction-structure.patch
1 From c9afdcdd2642485a6476906be9da2e811090fc7a Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Fri, 18 Mar 2022 18:06:03 +0100
4 Subject: [PATCH] switchdev: remove the transaction structure
5
6 Since 5.12 there is no transaction structure anymore, so drop it for
7 5.12 and newer.
8
9 Signed-off-by: Robert Marko <robimarko@gmail.com>
10 ---
11 nss_dp_switchdev.c | 10 ++++++++++
12 1 file changed, 10 insertions(+)
13
14 --- a/nss_dp_switchdev.c
15 +++ b/nss_dp_switchdev.c
16 @@ -279,13 +279,19 @@ void nss_dp_switchdev_setup(struct net_d
17 * Sets attributes
18 */
19 static int nss_dp_port_attr_set(struct net_device *dev,
20 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
21 const struct switchdev_attr *attr,
22 struct switchdev_trans *trans)
23 +#else
24 + const struct switchdev_attr *attr)
25 +#endif
26 {
27 struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(dev);
28
29 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
30 if (switchdev_trans_ph_prepare(trans))
31 return 0;
32 +#endif
33
34 switch (attr->id) {
35 case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
36 @@ -309,8 +315,12 @@ static int nss_dp_switchdev_port_attr_se
37 {
38 int err;
39
40 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
41 err = nss_dp_port_attr_set(netdev, port_attr_info->attr,
42 port_attr_info->trans);
43 +#else
44 + err = nss_dp_port_attr_set(netdev, port_attr_info->attr);
45 +#endif
46
47 port_attr_info->handled = true;
48 return notifier_from_errno(err);