add semantic patch which uses the dev member of struct gpio_chip on kenrel version < 4.5 This change was done in upstream kernel commit 58383c78 "gpio: change member .dev to .parent". Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx> --- .../generic/0002-gpio-parent.cocci | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 patches/collateral-evolutions/generic/0002-gpio-parent.cocci diff --git a/patches/collateral-evolutions/generic/0002-gpio-parent.cocci b/patches/collateral-evolutions/generic/0002-gpio-parent.cocci new file mode 100644 index 0000000..b266fac --- /dev/null +++ b/patches/collateral-evolutions/generic/0002-gpio-parent.cocci @@ -0,0 +1,25 @@ +/* convert gpio: change member .dev to .parent + * + * add semantic patch which uses the dev member of struct gpio_chip on + * kenrel version < 4.5 This change was done in upstream kernel commit + * 58383c78 "gpio: change member .dev to .parent". + */ + +@r1@ +struct gpio_chip *chip; +expression E1; +@@ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0) + chip->parent = E1; ++#else ++chip->dev = E1; ++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0) */ +@r2@ +struct gpio_chip chip; +expression E2; +@@ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0) + chip.parent = E2; ++#else ++chip.dev = E2; ++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0) */ -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe backports" in