[PATCH 5/6] patches: convert gpio: change member .dev to .parent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux