aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/oxnas
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-10-19 10:09:30 +0000
committerJohn Crispin <john@openwrt.org>2015-10-19 10:09:30 +0000
commit54b8ddf9e7cb7299d00a9e91c3bc9b2b4334e4fa (patch)
treea7373f49ba41e9886fc0849b7650da77a866314e /target/linux/oxnas
parent26329f650c55eb90c3178a99dd16fce141f45889 (diff)
downloadupstream-54b8ddf9e7cb7299d00a9e91c3bc9b2b4334e4fa.tar.gz
upstream-54b8ddf9e7cb7299d00a9e91c3bc9b2b4334e4fa.tar.bz2
upstream-54b8ddf9e7cb7299d00a9e91c3bc9b2b4334e4fa.zip
oxnas: prepare pinctrl for kernel >=4.2
Signed-off-by: Daniel Golle <daniel@makrotopia.org> SVN-Revision: 47217
Diffstat (limited to 'target/linux/oxnas')
-rw-r--r--target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c b/target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c
index fa5f3a9431..aa76f40e40 100644
--- a/target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c
+++ b/target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c
@@ -26,6 +26,7 @@
#include <linux/pinctrl/pinmux.h>
/* Since we request GPIOs from ourself */
#include <linux/pinctrl/consumer.h>
+#include <linux/version.h>
#include "core.h"
@@ -1187,7 +1188,11 @@ static struct irq_chip gpio_irqchip = {
.irq_set_type = gpio_irq_type,
};
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+#else
+static void gpio_irq_handler(struct irq_desc *desc)
+#endif
{
struct irq_chip *chip = irq_desc_get_chip(desc);
struct irq_data *idata = irq_desc_get_irq_data(desc);
@@ -1228,7 +1233,9 @@ static int oxnas_gpio_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_lockdep_class(virq, &gpio_lock_class);
irq_set_chip_and_handler(virq, &gpio_irqchip, handle_edge_irq);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
set_irq_flags(virq, IRQF_VALID);
+#endif
irq_set_chip_data(virq, oxnas_gpio);
return 0;