kernel: drop outdated kernel version switches for local code

This drops kernel version switches for versions not supported by
OpenWrt master at the moment. This only adjusts local code, but
doesn't touch patches to existing external packages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2020-05-13 14:00:57 +02:00 committed by AmadeusGhost
parent 6498b0ab23
commit 88e1c18692
12 changed files with 0 additions and 117 deletions

View File

@ -276,11 +276,7 @@ static int nct5104d_gpio_probe(struct platform_device *pdev)
for (i = 0; i < data->nr_bank; i++) {
struct nct5104d_gpio_bank *bank = &data->bank[i];
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)
bank->chip.dev = &pdev->dev;
#else
bank->chip.parent = &pdev->dev;
#endif
bank->data = data;
err = gpiochip_add(&bank->chip);
@ -298,15 +294,7 @@ err_gpiochip:
for (i = i - 1; i >= 0; i--) {
struct nct5104d_gpio_bank *bank = &data->bank[i];
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
int rm_err = gpiochip_remove(&bank->chip);
if (rm_err < 0)
dev_err(&pdev->dev,
"Failed to remove gpiochip %d: %d\n",
i, rm_err);
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */
gpiochip_remove (&bank->chip);
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */
}
return err;
@ -320,17 +308,7 @@ static int nct5104d_gpio_remove(struct platform_device *pdev)
for (i = 0; i < data->nr_bank; i++) {
struct nct5104d_gpio_bank *bank = &data->bank[i];
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
int err = gpiochip_remove(&bank->chip);
if (err) {
dev_err(&pdev->dev,
"Failed to remove GPIO gpiochip %d: %d\n",
i, err);
return err;
}
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */
gpiochip_remove (&bank->chip);
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */
}
return 0;

View File

@ -523,9 +523,7 @@ typedef struct DSL_DEV_Device
#define IFX_DFEIR 0
#define IFX_DYING_GASP 1
DSL_DEV_MeiDebug_t lop_debugwr; /* dying gasp */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
struct module *owner;
#endif
} DSL_DEV_Device_t; /* ifx_adsl_device_t */
#define DSL_DEV_PRIVATE(dev) ((ifx_mei_device_private_t*)(dev->pPriv))

View File

@ -1809,11 +1809,7 @@ static int ltq_atm_probe(struct platform_device *pdev)
}
/* register interrupt handler */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, 0, "atm_mailbox_isr", &g_atm_priv_data);
#else
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, IRQF_DISABLED, "atm_mailbox_isr", &g_atm_priv_data);
#endif
if ( ret ) {
if ( ret == -EBUSY ) {
pr_err("IRQ may be occupied by other driver, please reconfig to disable it.\n");

View File

@ -895,18 +895,6 @@ int ifxdeu_init_aes (void)
int ret = -ENOSYS;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
if (!disable_multiblock) {
ifxdeu_aes_alg.cra_u.cipher.cia_max_nbytes = AES_BLOCK_SIZE; //(size_t)-1;
ifxdeu_aes_alg.cra_u.cipher.cia_req_align = 16;
ifxdeu_aes_alg.cra_u.cipher.cia_ecb = ifx_deu_aes_ecb;
ifxdeu_aes_alg.cra_u.cipher.cia_cbc = ifx_deu_aes_cbc;
ifxdeu_aes_alg.cra_u.cipher.cia_cfb = ifx_deu_aes_cfb;
ifxdeu_aes_alg.cra_u.cipher.cia_ofb = ifx_deu_aes_ofb;
}
#endif
if ((ret = crypto_register_alg(&ifxdeu_aes_alg)))
goto aes_err;

View File

@ -100,11 +100,7 @@ extern char debug_level;
static int disable_multiblock = 0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
module_param(disable_multiblock, int, 0);
#else
MODULE_PARM_DESC(disable_multiblock, "Disable encryption of whole multiblock buffers");
#endif
static int disable_deudma = 1;

View File

@ -117,11 +117,7 @@ struct des_ctx {
static int disable_multiblock = 0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
module_param(disable_multiblock, int, 0);
#else
MODULE_PARM_DESC(disable_multiblock, "Disable encryption of whole multiblock buffers");
#endif
static int disable_deudma = 1;
@ -893,16 +889,6 @@ int __init lqdeu_async_des_init (void)
{
int i, j, ret = -EINVAL;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
if (!disable_multiblock) {
ifxdeu_des_alg.cra_u.cipher.cia_max_nbytes = DES_BLOCK_SIZE; //(size_t)-1;
ifxdeu_des_alg.cra_u.cipher.cia_req_align = 16;
ifxdeu_des_alg.cra_u.cipher.cia_ecb = ifx_deu_des_ecb;
ifxdeu_des_alg.cra_u.cipher.cia_cbc = ifx_deu_des_cbc;
ifxdeu_des_alg.cra_u.cipher.cia_cfb = ifx_deu_des_cfb;
ifxdeu_des_alg.cra_u.cipher.cia_ofb = ifx_deu_des_ofb;
}
#endif
for (i = 0; i < ARRAY_SIZE(des_drivers_alg); i++) {
ret = crypto_register_alg(&des_drivers_alg[i].alg);
//printk("driver: %s\n", des_drivers_alg[i].alg.cra_name);

View File

@ -691,17 +691,6 @@ int ifxdeu_init_des (void)
int ret = -ENOSYS;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
if (!disable_multiblock) {
ifxdeu_des_alg.cra_u.cipher.cia_max_nbytes = DES_BLOCK_SIZE; //(size_t)-1;
ifxdeu_des_alg.cra_u.cipher.cia_req_align = 16;
ifxdeu_des_alg.cra_u.cipher.cia_ecb = ifx_deu_des_ecb;
ifxdeu_des_alg.cra_u.cipher.cia_cbc = ifx_deu_des_cbc;
ifxdeu_des_alg.cra_u.cipher.cia_cfb = ifx_deu_des_cfb;
ifxdeu_des_alg.cra_u.cipher.cia_ofb = ifx_deu_des_ofb;
}
#endif
ret = crypto_register_alg(&ifxdeu_des_alg);
if (ret < 0)
goto des_err;

View File

@ -171,14 +171,8 @@ static int ltq_deu_remove(struct platform_device *pdev)
int disable_multiblock = 0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
module_param(disable_multiblock,int,0);
#else
//MODULE_PARM (disable_multiblock, "i");
MODULE_PARM_DESC (disable_multiblock,
"Disable encryption of whole multiblock buffers.");
#endif
static const struct of_device_id ltq_deu_match[] = {
#ifdef CONFIG_DANUBE

View File

@ -61,12 +61,8 @@
* Kernel Version Adaption
* ####################################
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
#define MODULE_PARM_ARRAY(a, b) module_param_array(a, int, NULL, 0)
#define MODULE_PARM(a, b) module_param(a, int, 0)
#else
#define MODULE_PARM_ARRAY(a, b) MODULE_PARM(a, b)
#endif
@ -243,7 +239,6 @@ static INLINE void init_tables(void);
static struct ptm_priv_data g_ptm_priv_data;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
static struct net_device_ops g_ptm_netdev_ops = {
.ndo_get_stats = ptm_get_stats,
.ndo_open = ptm_open,
@ -257,7 +252,6 @@ static struct net_device_ops g_ptm_netdev_ops = {
.ndo_do_ioctl = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
#endif
static struct net_device *g_net_dev[2] = {0};
static char *g_net_dev_name[2] = {"dsl0", "dslfast0"};
@ -415,11 +409,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* allocate descriptor */
desc_base = get_tx_desc(ndev, &f_full);
if ( f_full ) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
netif_trans_update(dev);
#else
dev->trans_start = jiffies;
#endif
netif_stop_queue(dev);
IFX_REG_W32_MASK(0, 1 << (ndev + 16), MBOX_IGU1_ISRC);
@ -453,11 +443,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
g_ptm_priv_data.itf[ndev].stats.tx_packets++;
g_ptm_priv_data.itf[ndev].stats.tx_bytes += reg_desc.datalen;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
netif_trans_update(dev);
#else
dev->trans_start = jiffies;
#endif
mailbox_signal(ndev, 1);
adsl_led_flash();
@ -1513,11 +1499,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
}
/* register interrupt handler */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, 0, "ptm_mailbox_isr", &g_ptm_priv_data);
#else
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, IRQF_DISABLED, "ptm_mailbox_isr", &g_ptm_priv_data);
#endif
if ( ret ) {
if ( ret == -EBUSY ) {
err("IRQ may be occupied by other driver, please reconfig to disable it.");

View File

@ -301,11 +301,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* allocate descriptor */
desc_base = get_tx_desc(0, &f_full);
if ( f_full ) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
netif_trans_update(dev);
#else
dev->trans_start = jiffies;
#endif
netif_stop_queue(dev);
IFX_REG_W32_MASK(0, 1 << 17, MBOX_IGU1_ISRC);
@ -367,11 +363,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
wmb();
*(volatile unsigned int *)desc = *(unsigned int *)&reg_desc;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
netif_trans_update(dev);
#else
dev->trans_start = jiffies;
#endif
return 0;
@ -1024,11 +1016,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
}
/* register interrupt handler */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, 0, "ptm_mailbox_isr", &g_ptm_priv_data);
#else
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, IRQF_DISABLED, "ptm_mailbox_isr", &g_ptm_priv_data);
#endif
if ( ret ) {
if ( ret == -EBUSY ) {
err("IRQ may be occupied by other driver, please reconfig to disable it.");

View File

@ -194,11 +194,7 @@ static int gpio_apu2_probe (struct platform_device *dev)
}
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)
gpio_apu2_chip.dev = &dev->dev;
#else
gpio_apu2_chip.parent = &dev->dev;
#endif
ret = gpiochip_add (&gpio_apu2_chip);
if (ret) {
pr_err ("%s: adding gpiochip failed\n", DEVNAME);
@ -209,12 +205,7 @@ static int gpio_apu2_probe (struct platform_device *dev)
static int gpio_apu2_remove (struct platform_device *dev)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
int ret;
ret = gpiochip_remove (&gpio_apu2_chip);
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */
gpiochip_remove (&gpio_apu2_chip);
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */
return 0;
}

View File

@ -57,9 +57,6 @@
#include <linux/uaccess.h>
#include <asm/current.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
#include <asm/system.h>
#endif
#include <bcm47xx.h>
#include <linux/bcm47xx_nvram.h>