summaryrefslogtreecommitdiff
path: root/patches/0082-pci_error_handlers.cocci
blob: 2a1fc3885235da52fe3f76b0f740f0fe5ab1f2e6 (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
@r@
identifier OPS;
identifier pcie_reset_prepare_fn;
identifier pcie_reset_done_fn;
fresh identifier pcie_reset_notify_fn = pcie_reset_prepare_fn ## "_notify";
position p;
@@
struct pci_error_handlers OPS@p = {
+#if LINUX_VERSION_IS_GEQ(4,13,0)
	.reset_prepare = pcie_reset_prepare_fn,
	.reset_done = pcie_reset_done_fn,
+#elif LINUX_VERSION_IS_GEQ(3,16,0)
+	.reset_notify = pcie_reset_notify_fn,
+#endif
};


@@
identifier r.pcie_reset_prepare_fn;
identifier r.pcie_reset_done_fn;
identifier r.pcie_reset_notify_fn;
@@
void pcie_reset_done_fn(...) {...}
+#if LINUX_VERSION_IS_LESS(4,13,0)
+static void pcie_reset_notify_fn(struct pci_dev *dev, bool prepare)
+{
+	if (prepare)
+		pcie_reset_prepare_fn(dev);
+	else
+		pcie_reset_done_fn(dev);
+}
+#endif