summaryrefslogtreecommitdiff
path: root/patches/0087-led-activate.cocci
blob: 674db0467b5cd3abdeaa8e9c1b30229a876a1881 (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
@act@
identifier activate_fn, p;
identifier m =~ "rx_led|tx_led|assoc_led|radio_led|tpt_led";
fresh identifier activate_fn_wrap = "bp_" ## activate_fn;
@@
<+...
+#if LINUX_VERSION_IS_GEQ(4,19,0)
p->m.activate = activate_fn;
+#else
+p->m.activate = activate_fn_wrap;
+#endif
...+>

@@
identifier act.activate_fn;
identifier act.activate_fn_wrap;
@@
int activate_fn(...) {...}
+#if LINUX_VERSION_IS_LESS(4,19,0)
+static void activate_fn_wrap(struct led_classdev *led_cdev)
+{
+	activate_fn(led_cdev);
+}
+#endif