From: Daniel Golle Date: Wed, 4 Jan 2017 18:40:32 +0000 (+0100) Subject: oxnas: remove support for pre-4.4 kernels from drivers X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a46c9a4038f385e53b49b42a1e195b1fc3261842;p=openwrt%2Fstaging%2Fjow.git oxnas: remove support for pre-4.4 kernels from drivers Signed-off-by: Daniel Golle --- diff --git a/target/linux/oxnas/files/arch/arm/mach-oxnas/mach-ox820.c b/target/linux/oxnas/files/arch/arm/mach-oxnas/mach-ox820.c index 4d648c63d2..31b7c90582 100644 --- a/target/linux/oxnas/files/arch/arm/mach-oxnas/mach-ox820.c +++ b/target/linux/oxnas/files/arch/arm/mach-oxnas/mach-ox820.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -74,11 +73,7 @@ static void __init ox820_dt_init(void) static void __init ox820_timer_init(void) { of_clk_init(NULL); -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) - clocksource_of_init(); -#else clocksource_probe(); -#endif } void ox820_init_early(void) diff --git a/target/linux/oxnas/files/drivers/irqchip/irq-rps.c b/target/linux/oxnas/files/drivers/irqchip/irq-rps.c index 1e75ea12be..f2b0829de6 100644 --- a/target/linux/oxnas/files/drivers/irqchip/irq-rps.c +++ b/target/linux/oxnas/files/drivers/irqchip/irq-rps.c @@ -6,13 +6,7 @@ #include #include #include -#include - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) -# include "irqchip.h" -#else -# include -#endif +#include struct rps_chip_data { void __iomem *base; @@ -62,11 +56,7 @@ static int rps_irq_domain_xlate(struct irq_domain *d, unsigned long *out_hwirq, unsigned int *out_type) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) - if (d->of_node != controller) -#else if (irq_domain_get_of_node(d) != controller) -#endif return -EINVAL; if (intsize < 1) return -EINVAL; @@ -82,11 +72,7 @@ static int rps_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) { irq_set_chip_and_handler(irq, &rps_chip, handle_level_irq); -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); -#else irq_set_probe(irq); -#endif irq_set_chip_data(irq, d->host_data); return 0; } @@ -96,11 +82,7 @@ const struct irq_domain_ops rps_irq_domain_ops = { .xlate = rps_irq_domain_xlate, }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) -static void rps_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) -#else static void rps_handle_cascade_irq(struct irq_desc *desc) -#endif { struct rps_chip_data *chip_data = irq_desc_get_handler_data(desc); struct irq_chip *chip = irq_desc_get_chip(desc); @@ -114,11 +96,7 @@ static void rps_handle_cascade_irq(struct irq_desc *desc) cascade_irq = irq_find_mapping(chip_data->domain, rps_irq); if (unlikely(rps_irq >= RPS_IRQ_COUNT)) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) - handle_bad_irq(cascade_irq, desc); -#else handle_bad_irq(desc); -#endif else generic_handle_irq(cascade_irq); diff --git a/target/linux/oxnas/files/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c b/target/linux/oxnas/files/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c index 07f9f44497..aafb118144 100644 --- a/target/linux/oxnas/files/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c +++ b/target/linux/oxnas/files/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c @@ -25,7 +25,6 @@ #include #include #include -#include #include @@ -92,37 +91,21 @@ static void oxnas_gmac_exit(struct platform_device *pdev, void *priv) } } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) -static void *oxnas_gmac_probe(struct platform_device *pdev) -{ -#else static int oxnas_gmac_probe(struct platform_device *pdev) { struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; int ret; -#endif struct device *dev = &pdev->dev; struct oxnas_gmac *bsp_priv; bsp_priv = devm_kzalloc(dev, sizeof(*bsp_priv), GFP_KERNEL); if (!bsp_priv) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) - return ERR_PTR(-ENOMEM); -#else return -ENOMEM; -#endif bsp_priv->clk = devm_clk_get(dev, "gmac"); if (IS_ERR(bsp_priv->clk)) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) - return bsp_priv->clk; -#else return PTR_ERR(bsp_priv->clk); -#endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) - return bsp_priv; -#else ret = stmmac_get_platform_resources(pdev, &stmmac_res); if (ret) return ret; @@ -140,17 +123,8 @@ static int oxnas_gmac_probe(struct platform_device *pdev) return ret; return stmmac_dvr_probe(dev, plat_dat, &stmmac_res); -#endif } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) -const struct stmmac_of_data oxnas_gmac_data = { - .has_gmac = 1, - .setup = oxnas_gmac_probe, - .init = oxnas_gmac_init, - .exit = oxnas_gmac_exit, -}; -#else static const struct of_device_id oxnas_gmac_match[] = { { .compatible = "plxtech,nas782x-gmac" }, { } @@ -167,6 +141,5 @@ static struct platform_driver oxnas_gmac_driver = { }, }; module_platform_driver(oxnas_gmac_driver); -#endif MODULE_LICENSE("GPL v2"); diff --git a/target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c b/target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c index 034a7304d4..38a8cbb451 100644 --- a/target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c +++ b/target/linux/oxnas/files/drivers/pinctrl/pinctrl-oxnas.c @@ -27,7 +27,6 @@ /* Since we request GPIOs from ourself */ #include #include -#include #include "core.h" @@ -1200,11 +1199,7 @@ 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); @@ -1245,9 +1240,6 @@ 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;