diff options
Diffstat (limited to 'drivers/staging/silicom')
-rw-r--r-- | drivers/staging/silicom/bp_mod.c | 219 | ||||
-rw-r--r-- | drivers/staging/silicom/bp_proc.c | 85 | ||||
-rw-r--r-- | drivers/staging/silicom/bypasslib/bplibk.h | 9 | ||||
-rw-r--r-- | drivers/staging/silicom/bypasslib/bypass.c | 1 |
4 files changed, 36 insertions, 278 deletions
diff --git a/drivers/staging/silicom/bp_mod.c b/drivers/staging/silicom/bp_mod.c index 3cfd051..58c5f5c 100644 --- a/drivers/staging/silicom/bp_mod.c +++ b/drivers/staging/silicom/bp_mod.c @@ -9,7 +9,6 @@ /* */ /* */ /******************************************************************************/ -#include <linux/version.h> #include <linux/kernel.h> /* We're doing kernel work */ #include <linux/module.h> /* Specifically, a module */ @@ -4319,16 +4318,6 @@ void remove_bypass_wd_auto(bpctl_dev_t *pbpctl_dev) del_timer_sync(&pbpctl_dev->bp_timer); #ifdef BP_SELF_TEST pbpctl_dev_sl = get_status_port_fn(pbpctl_dev); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) - if (pbpctl_dev_sl && (pbpctl_dev_sl->ndev) - && (pbpctl_dev_sl->ndev->hard_start_xmit) - && (pbpctl_dev_sl->hard_start_xmit_save)) { - rtnl_lock(); - pbpctl_dev_sl->ndev->hard_start_xmit = - pbpctl_dev_sl->hard_start_xmit_save; - rtnl_unlock(); - } -#else if (pbpctl_dev_sl && (pbpctl_dev_sl->ndev)) { if ((pbpctl_dev_sl->ndev->netdev_ops) && (pbpctl_dev_sl->old_ops)) { @@ -4342,8 +4331,6 @@ void remove_bypass_wd_auto(bpctl_dev_t *pbpctl_dev) } } - -#endif #endif } @@ -4433,23 +4420,7 @@ int set_bp_self_test(bpctl_dev_t *pbpctl_dev, unsigned int param) if (pbpctl_dev->bp_caps & WD_CTL_CAP) { pbpctl_dev->bp_self_test_flag = param == 0 ? 0 : 1; pbpctl_dev_sl = get_status_port_fn(pbpctl_dev); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) - if ((pbpctl_dev_sl->ndev) && - (pbpctl_dev_sl->ndev->hard_start_xmit)) { - rtnl_lock(); - if (pbpctl_dev->bp_self_test_flag == 1) { - pbpctl_dev_sl->hard_start_xmit_save = - pbpctl_dev_sl->ndev->hard_start_xmit; - pbpctl_dev_sl->ndev->hard_start_xmit = - bp_hard_start_xmit; - } else if (pbpctl_dev_sl->hard_start_xmit_save) { - pbpctl_dev_sl->ndev->hard_start_xmit = - pbpctl_dev_sl->hard_start_xmit_save; - } - rtnl_unlock(); - } -#else if ((pbpctl_dev_sl->ndev) && (pbpctl_dev_sl->ndev->netdev_ops)) { rtnl_lock(); if (pbpctl_dev->bp_self_test_flag == 1) { @@ -4470,7 +4441,6 @@ int set_bp_self_test(bpctl_dev_t *pbpctl_dev, unsigned int param) } rtnl_unlock(); } -#endif set_bypass_wd_auto(pbpctl_dev, param); return 0; @@ -5428,15 +5398,8 @@ static void if_scan_init(void) /* rcu_read_lock(); */ /* rtnl_lock(); */ /* rcu_read_lock(); */ -#if 1 -#if (LINUX_VERSION_CODE >= 0x020618) - for_each_netdev(&init_net, dev) -#elif (LINUX_VERSION_CODE >= 0x20616) - for_each_netdev(dev) -#else - for (dev = dev_base; dev; dev = dev->next) -#endif - { + + for_each_netdev(&init_net, dev) { struct ethtool_drvinfo drvinfo; char cbuf[32]; @@ -5454,8 +5417,6 @@ static void if_scan_init(void) dev->ethtool_ops->get_drvinfo(dev, &drvinfo); } else continue; - if (!drvinfo.bus_info) - continue; if (!strcmp(drvinfo.bus_info, "N/A")) continue; memcpy(&cbuf, drvinfo.bus_info, 32); @@ -5491,22 +5452,14 @@ static void if_scan_init(void) } } -#endif /* rtnl_unlock(); */ /* rcu_read_unlock(); */ } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)) -static int device_ioctl(struct inode *inode, /* see include/linux/fs.h */ - struct file *file, /* ditto */ - unsigned int ioctl_num, /* number and param for ioctl */ - unsigned long ioctl_param) -#else -static long device_ioctl(struct file *file, /* ditto */ +static long device_ioctl(struct file *file, /* see include/linux/fs.h */ unsigned int ioctl_num, /* number and param for ioctl */ unsigned long ioctl_param) -#endif { struct bpctl_cmd bpctl_cmd; int dev_idx = 0; @@ -5517,9 +5470,7 @@ static long device_ioctl(struct file *file, /* ditto */ static bpctl_dev_t *pbpctl_dev; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)) /* lock_kernel(); */ -#endif lock_bpctl(); /* local_irq_save(flags); */ /* if(!spin_trylock_irqsave(&bpvm_lock)){ @@ -5900,9 +5851,7 @@ static long device_ioctl(struct file *file, /* ditto */ ret = -EFAULT; ret = SUCCESS; bp_exit: -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)) /* unlock_kernel(); */ -#endif /* spin_unlock_irqrestore(&bpvm_lock, flags); */ unlock_bpctl(); /* unlock_kernel(); */ @@ -5911,12 +5860,7 @@ static long device_ioctl(struct file *file, /* ditto */ struct file_operations Fops = { .owner = THIS_MODULE, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)) - .ioctl = device_ioctl, -#else .unlocked_ioctl = device_ioctl, -#endif - .open = device_open, .release = device_release, /* a.k.a. close */ }; @@ -6952,15 +6896,8 @@ static int __init bypass_init_module(void) memset(bpctl_dev_arr[idx_dev].bp_tx_data + 7, 0xaa, 5); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) - bpctl_dev_arr[idx_dev].bp_tx_data[12] = - (ETH_P_BPTEST >> 8) & 0xff; - bpctl_dev_arr[idx_dev].bp_tx_data[13] = - ETH_P_BPTEST & 0xff; -#else *(__be16 *) (bpctl_dev_arr[idx_dev].bp_tx_data + 12) = htons(ETH_P_BPTEST); -#endif } else printk("bp_ctl: Memory allocation error!\n"); @@ -7009,83 +6946,6 @@ static int __init bypass_init_module(void) } } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) - inter_module_register("is_bypass_sd", THIS_MODULE, &is_bypass_sd); - inter_module_register("get_bypass_slave_sd", THIS_MODULE, - &get_bypass_slave_sd); - inter_module_register("get_bypass_caps_sd", THIS_MODULE, - &get_bypass_caps_sd); - inter_module_register("get_wd_set_caps_sd", THIS_MODULE, - &get_wd_set_caps_sd); - inter_module_register("set_bypass_sd", THIS_MODULE, &set_bypass_sd); - inter_module_register("get_bypass_sd", THIS_MODULE, &get_bypass_sd); - inter_module_register("get_bypass_change_sd", THIS_MODULE, - &get_bypass_change_sd); - inter_module_register("set_dis_bypass_sd", THIS_MODULE, - &set_dis_bypass_sd); - inter_module_register("get_dis_bypass_sd", THIS_MODULE, - &get_dis_bypass_sd); - inter_module_register("set_bypass_pwoff_sd", THIS_MODULE, - &set_bypass_pwoff_sd); - inter_module_register("get_bypass_pwoff_sd", THIS_MODULE, - &get_bypass_pwoff_sd); - inter_module_register("set_bypass_pwup_sd", THIS_MODULE, - &set_bypass_pwup_sd); - inter_module_register("get_bypass_pwup_sd", THIS_MODULE, - &get_bypass_pwup_sd); - inter_module_register("get_bypass_wd_sd", THIS_MODULE, - &get_bypass_wd_sd); - inter_module_register("set_bypass_wd_sd", THIS_MODULE, - &set_bypass_wd_sd); - inter_module_register("get_wd_expire_time_sd", THIS_MODULE, - &get_wd_expire_time_sd); - inter_module_register("reset_bypass_wd_timer_sd", THIS_MODULE, - &reset_bypass_wd_timer_sd); - inter_module_register("set_std_nic_sd", THIS_MODULE, &set_std_nic_sd); - inter_module_register("get_std_nic_sd", THIS_MODULE, &get_std_nic_sd); - inter_module_register("set_tx_sd", THIS_MODULE, &set_tx_sd); - inter_module_register("get_tx_sd", THIS_MODULE, &get_tx_sd); - inter_module_register("set_tpl_sd", THIS_MODULE, &set_tpl_sd); - inter_module_register("get_tpl_sd", THIS_MODULE, &get_tpl_sd); - - inter_module_register("set_bp_hw_reset_sd", THIS_MODULE, - &set_bp_hw_reset_sd); - inter_module_register("get_bp_hw_reset_sd", THIS_MODULE, - &get_bp_hw_reset_sd); - - inter_module_register("set_tap_sd", THIS_MODULE, &set_tap_sd); - inter_module_register("get_tap_sd", THIS_MODULE, &get_tap_sd); - inter_module_register("get_tap_change_sd", THIS_MODULE, - &get_tap_change_sd); - inter_module_register("set_dis_tap_sd", THIS_MODULE, &set_dis_tap_sd); - inter_module_register("get_dis_tap_sd", THIS_MODULE, &get_dis_tap_sd); - inter_module_register("set_tap_pwup_sd", THIS_MODULE, &set_tap_pwup_sd); - inter_module_register("get_tap_pwup_sd", THIS_MODULE, &get_tap_pwup_sd); - inter_module_register("set_bp_disc_sd", THIS_MODULE, &set_bp_disc_sd); - inter_module_register("get_bp_disc_sd", THIS_MODULE, &get_bp_disc_sd); - inter_module_register("get_bp_disc_change_sd", THIS_MODULE, - &get_bp_disc_change_sd); - inter_module_register("set_bp_dis_disc_sd", THIS_MODULE, - &set_bp_dis_disc_sd); - inter_module_register("get_bp_dis_disc_sd", THIS_MODULE, - &get_bp_dis_disc_sd); - inter_module_register("set_bp_disc_pwup_sd", THIS_MODULE, - &set_bp_disc_pwup_sd); - inter_module_register("get_bp_disc_pwup_sd", THIS_MODULE, - &get_bp_disc_pwup_sd); - inter_module_register("set_wd_exp_mode_sd", THIS_MODULE, - &set_wd_exp_mode_sd); - inter_module_register("get_wd_exp_mode_sd", THIS_MODULE, - &get_wd_exp_mode_sd); - inter_module_register("set_wd_autoreset_sd", THIS_MODULE, - &set_wd_autoreset_sd); - inter_module_register("get_wd_autoreset_sd", THIS_MODULE, - &get_wd_autoreset_sd); - inter_module_register("get_bypass_info_sd", THIS_MODULE, - &get_bypass_info_sd); - inter_module_register("bp_if_scan_sd", THIS_MODULE, &bp_if_scan_sd); - -#endif register_netdevice_notifier(&bp_notifier_block); #ifdef BP_PROC_SUPPORT { @@ -7115,58 +6975,8 @@ static int __init bypass_init_module(void) static void __exit bypass_cleanup_module(void) { int i; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) - int ret; -#endif unregister_netdevice_notifier(&bp_notifier_block); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) - inter_module_unregister("is_bypass_sd"); - inter_module_unregister("get_bypass_slave_sd"); - inter_module_unregister("get_bypass_caps_sd"); - inter_module_unregister("get_wd_set_caps_sd"); - inter_module_unregister("set_bypass_sd"); - inter_module_unregister("get_bypass_sd"); - inter_module_unregister("get_bypass_change_sd"); - inter_module_unregister("set_dis_bypass_sd"); - inter_module_unregister("get_dis_bypass_sd"); - inter_module_unregister("set_bypass_pwoff_sd"); - inter_module_unregister("get_bypass_pwoff_sd"); - inter_module_unregister("set_bypass_pwup_sd"); - inter_module_unregister("get_bypass_pwup_sd"); - inter_module_unregister("set_bypass_wd_sd"); - inter_module_unregister("get_bypass_wd_sd"); - inter_module_unregister("get_wd_expire_time_sd"); - inter_module_unregister("reset_bypass_wd_timer_sd"); - inter_module_unregister("set_std_nic_sd"); - inter_module_unregister("get_std_nic_sd"); - inter_module_unregister("set_tx_sd"); - inter_module_unregister("get_tx_sd"); - inter_module_unregister("set_tpl_sd"); - inter_module_unregister("get_tpl_sd"); - inter_module_unregister("set_tap_sd"); - inter_module_unregister("get_tap_sd"); - inter_module_unregister("get_tap_change_sd"); - inter_module_unregister("set_dis_tap_sd"); - inter_module_unregister("get_dis_tap_sd"); - inter_module_unregister("set_tap_pwup_sd"); - inter_module_unregister("get_tap_pwup_sd"); - inter_module_unregister("set_bp_disc_sd"); - inter_module_unregister("get_bp_disc_sd"); - inter_module_unregister("get_bp_disc_change_sd"); - inter_module_unregister("set_bp_dis_disc_sd"); - inter_module_unregister("get_bp_dis_disc_sd"); - inter_module_unregister("set_bp_disc_pwup_sd"); - inter_module_unregister("get_bp_disc_pwup_sd"); - inter_module_unregister("set_wd_exp_mode_sd"); - inter_module_unregister("get_wd_exp_mode_sd"); - inter_module_unregister("set_wd_autoreset_sd"); - inter_module_unregister("get_wd_autoreset_sd"); - inter_module_unregister("get_bypass_info_sd"); - inter_module_unregister("bp_if_scan_sd"); - -#endif - for (i = 0; i < device_num; i++) { /* unsigned long flags; */ #ifdef BP_PROC_SUPPORT @@ -7198,17 +7008,7 @@ static void __exit bypass_cleanup_module(void) /* * Unregister the device */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) - ret = unregister_chrdev(major_num, DEVICE_NAME); -/* -* If there's an error, report it -*/ - if (ret < 0) - printk("Error in module_unregister_chrdev: %d\n", ret); -#else unregister_chrdev(major_num, DEVICE_NAME); - -#endif } module_init(bypass_init_module); @@ -7597,11 +7397,7 @@ static struct proc_dir_entry *proc_getdir(char *name, } if (pde == (struct proc_dir_entry *)0) { /* create the directory */ -#if (LINUX_VERSION_CODE > 0x20300) pde = proc_mkdir(name, proc_dir); -#else - pde = create_proc_entry(name, S_IFDIR, proc_dir); -#endif if (pde == (struct proc_dir_entry *)0) { return pde; @@ -7703,13 +7499,8 @@ get_bypass_slave_pfs(char *page, char **start, off_t off, int count, return len; } net_slave_dev = pbp_device_block_slave->ndev; - if (net_slave_dev) { - if (net_slave_dev) - len = sprintf(page, "%s\n", net_slave_dev->name); - else - len = sprintf(page, "fail\n"); - - } + if (net_slave_dev) + len = sprintf(page, "%s\n", net_slave_dev->name); *eof = 1; return len; diff --git a/drivers/staging/silicom/bp_proc.c b/drivers/staging/silicom/bp_proc.c index 6ad4b27..a01ca97 100644 --- a/drivers/staging/silicom/bp_proc.c +++ b/drivers/staging/silicom/bp_proc.c @@ -10,21 +10,20 @@ /* */ /******************************************************************************/ -#include <linux/version.h> -#if defined(CONFIG_SMP) && ! defined(__SMP__) +#if defined(CONFIG_SMP) && !defined(__SMP__) #define __SMP__ #endif #include <linux/proc_fs.h> #include <linux/netdevice.h> #include <asm/uaccess.h> -//#include <linux/smp_lock.h> +/* #include <linux/smp_lock.h> */ #include "bp_mod.h" #define BP_PROC_DIR "bypass" -//#define BYPASS_SUPPORT "bypass" +/* #define BYPASS_SUPPORT "bypass" */ -#ifdef BYPASS_SUPPORT +#ifdef BYPASS_SUPPORT #define GPIO6_SET_ENTRY_SD "gpio6_set" #define GPIO6_CLEAR_ENTRY_SD "gpio6_clear" @@ -70,7 +69,7 @@ #define DISC_CHANGE_ENTRY_SD "disc_change" #define DIS_DISC_ENTRY_SD "dis_disc" #define DISC_PWUP_ENTRY_SD "disc_pwup" -#endif //bypass_support + static struct proc_dir_entry *bp_procfs_dir; static struct proc_dir_entry *proc_getdir(char *name, @@ -86,20 +85,17 @@ static struct proc_dir_entry *proc_getdir(char *name, if (pde == (struct proc_dir_entry *)0) { /* create the directory */ pde = create_proc_entry(name, S_IFDIR, proc_dir); - if (pde == (struct proc_dir_entry *)0) { - return (pde); - } + if (pde == (struct proc_dir_entry *)0) + return pde; } - return (pde); + return pde; } -#ifdef BYPASS_SUPPORT - int bypass_proc_create_entry_sd(struct pfs_unit *pfs_unit_curr, char *proc_name, - write_proc_t * write_proc, - read_proc_t * read_proc, + write_proc_t *write_proc, + read_proc_t *read_proc, struct proc_dir_entry *parent_pfs, void *data) { strcpy(pfs_unit_curr->proc_name, proc_name); @@ -107,10 +103,8 @@ bypass_proc_create_entry_sd(struct pfs_unit *pfs_unit_curr, S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, parent_pfs); - if (pfs_unit_curr->proc_entry == 0) { - + if (pfs_unit_curr->proc_entry == 0) return -1; - } pfs_unit_curr->proc_entry->read_proc = read_proc; pfs_unit_curr->proc_entry->write_proc = write_proc; @@ -207,9 +201,8 @@ set_bypass_pfs(struct file *file, const char *buffer, if (count > (sizeof(kbuf) - 1)) return -1; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -239,9 +232,8 @@ set_tap_pfs(struct file *file, const char *buffer, if (count > (sizeof(kbuf) - 1)) return -1; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -271,9 +263,8 @@ set_disc_pfs(struct file *file, const char *buffer, if (count > (sizeof(kbuf) - 1)) return -1; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -421,9 +412,8 @@ set_bypass_wd_pfs(struct file *file, const char *buffer, unsigned int timeout = 0; char *timeout_ptr = kbuf; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } timeout_ptr = kbuf; timeout = atoi(&timeout_ptr); @@ -570,9 +560,8 @@ set_dis_bypass_pfs(struct file *file, const char *buffer, int bypass_param = 0, length = 0; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -599,9 +588,8 @@ set_dis_tap_pfs(struct file *file, const char *buffer, int tap_param = 0, length = 0; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -628,9 +616,8 @@ set_dis_disc_pfs(struct file *file, const char *buffer, int tap_param = 0, length = 0; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -717,9 +704,8 @@ set_bypass_pwup_pfs(struct file *file, const char *buffer, int bypass_param = 0, length = 0; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -746,9 +732,8 @@ set_bypass_pwoff_pfs(struct file *file, const char *buffer, int bypass_param = 0, length = 0; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -775,9 +760,8 @@ set_tap_pwup_pfs(struct file *file, const char *buffer, int tap_param = 0, length = 0; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -804,9 +788,8 @@ set_disc_pwup_pfs(struct file *file, const char *buffer, int tap_param = 0, length = 0; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -913,9 +896,8 @@ set_std_nic_pfs(struct file *file, const char *buffer, int bypass_param = 0, length = 0; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -988,9 +970,8 @@ set_wd_exp_mode_pfs(struct file *file, const char *buffer, if (count > (sizeof(kbuf) - 1)) return -1; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -1036,9 +1017,8 @@ set_wd_autoreset_pfs(struct file *file, const char *buffer, u32 timeout = 0; char *timeout_ptr = kbuf; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } timeout_ptr = kbuf; timeout = atoi(&timeout_ptr); @@ -1061,9 +1041,8 @@ set_tpl_pfs(struct file *file, const char *buffer, if (count > (sizeof(kbuf) - 1)) return -1; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -1094,9 +1073,8 @@ set_wait_at_pwup_pfs(struct file *file, const char *buffer, if (count > (sizeof(kbuf) - 1)) return -1; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -1126,9 +1104,8 @@ set_hw_reset_pfs(struct file *file, const char *buffer, if (count > (sizeof(kbuf) - 1)) return -1; - if (copy_from_user(&kbuf, buffer, count)) { + if (copy_from_user(&kbuf, buffer, count)) return -1; - } kbuf[count] = '\0'; length = strlen(kbuf); @@ -1147,10 +1124,10 @@ set_hw_reset_pfs(struct file *file, const char *buffer, #endif /*PMC_FIX_FLAG */ -int bypass_proc_create_dev_sd(bpctl_dev_t * pbp_device_block) +int bypass_proc_create_dev_sd(bpctl_dev_t *pbp_device_block) { struct bypass_pfs_sd *current_pfs = &(pbp_device_block->bypass_pfs_set); - static struct proc_dir_entry *procfs_dir = NULL; + static struct proc_dir_entry *procfs_dir; int ret = 0; sprintf(current_pfs->dir_name, "bypass_%s", dev->name); @@ -1327,7 +1304,7 @@ int bypass_proc_create_dev_sd(bpctl_dev_t * pbp_device_block) return ret; } -int bypass_proc_remove_dev_sd(bpctl_dev_t * pbp_device_block) +int bypass_proc_remove_dev_sd(bpctl_dev_t *pbp_device_block) { struct bypass_pfs_sd *current_pfs = &pbp_device_block->bypass_pfs_set; diff --git a/drivers/staging/silicom/bypasslib/bplibk.h b/drivers/staging/silicom/bypasslib/bplibk.h index a1c85ee..d8c1d27 100644 --- a/drivers/staging/silicom/bypasslib/bplibk.h +++ b/drivers/staging/silicom/bypasslib/bplibk.h @@ -28,16 +28,7 @@ ((pid==INTEL_PEG4BPII_PID)|| \ (pid==INTEL_PEG4BPFII_PID))) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) -#define pci_get_class pci_find_class - -#define pci_get_device pci_find_device - -#endif - -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10)) #define EXPORT_SYMBOL_NOVERS EXPORT_SYMBOL -#endif #ifdef BP_VENDOR_SUPPORT char *bp_desc_array[] = diff --git a/drivers/staging/silicom/bypasslib/bypass.c b/drivers/staging/silicom/bypasslib/bypass.c index 527829d..95a1f18 100644 --- a/drivers/staging/silicom/bypasslib/bypass.c +++ b/drivers/staging/silicom/bypasslib/bypass.c @@ -11,7 +11,6 @@ /* */ /******************************************************************************/ -#include <linux/version.h> #if defined(CONFIG_SMP) && ! defined(__SMP__) #define __SMP__ #endif |