#include <linux/slab.h>
#include <linux/gfp.h>
#include <linux/reset.h>
-#include <linux/version.h>
#include <asm/mach-types.h>
#include <asm/mach/map.h>
#include <asm/mach/arch.h>
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)
#include <linux/irqchip/chained_irq.h>
#include <linux/err.h>
#include <linux/io.h>
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
-# include "irqchip.h"
-#else
-# include <linux/irqchip.h>
-#endif
+#include <linux/irqchip.h>
struct rps_chip_data {
void __iomem *base;
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;
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;
}
.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);
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);
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/stmmac.h>
-#include <linux/version.h>
#include <mach/hardware.h>
}
}
-#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;
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" },
{ }
},
};
module_platform_driver(oxnas_gmac_driver);
-#endif
MODULE_LICENSE("GPL v2");
/* Since we request GPIOs from ourself */
#include <linux/pinctrl/consumer.h>
#include <linux/spinlock.h>
-#include <linux/version.h>
#include "core.h"
.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);
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;