add doit.sh
[openwrt/staging/blogic.git] / patches / 0002-gpio-parent.cocci
1 /* convert gpio: change member .dev to .parent
2 *
3 * add semantic patch which uses the dev member of struct gpio_chip on
4 * kenrel version < 4.5 This change was done in upstream kernel commit
5 * 58383c78 "gpio: change member .dev to .parent".
6 */
7
8 @r1@
9 struct gpio_chip *chip;
10 expression E1;
11 @@
12 +#if LINUX_VERSION_IS_GEQ(4,5,0)
13 chip->parent = E1;
14 +#else
15 +chip->dev = E1;
16 +#endif /* LINUX_VERSION_IS_GEQ(4,5,0) */
17 @r2@
18 struct gpio_chip chip;
19 expression E2;
20 @@
21 +#if LINUX_VERSION_IS_GEQ(4,5,0)
22 chip.parent = E2;
23 +#else
24 +chip.dev = E2;
25 +#endif /* LINUX_VERSION_IS_GEQ(4,5,0) */