diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/arm/etherh.c | 2 | ||||
-rw-r--r-- | drivers/net/irda/pxaficp_ir.c | 24 | ||||
-rw-r--r-- | drivers/net/ppp_generic.c | 2 | ||||
-rw-r--r-- | drivers/net/tun.c | 13 | ||||
-rw-r--r-- | drivers/net/wan/cosa.c | 22 |
6 files changed, 29 insertions, 36 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index f4182cfffe9d..45a41b597da9 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -217,7 +217,7 @@ config MII config MACB tristate "Atmel MACB support" - depends on AVR32 || ARCH_AT91SAM9260 || ARCH_AT91SAM9263 || ARCH_AT91CAP9 + depends on AVR32 || ARCH_AT91SAM9260 || ARCH_AT91SAM9263 || ARCH_AT91SAM9G20 || ARCH_AT91CAP9 select PHYLIB help The Atmel MACB ethernet interface is found on many AT32 and AT91 diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c index 00081d2b9cd5..e9d15eccad08 100644 --- a/drivers/net/arm/etherh.c +++ b/drivers/net/arm/etherh.c @@ -647,7 +647,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) struct ei_device *ei_local; struct net_device *dev; struct etherh_priv *eh; - int i, ret; + int ret; DECLARE_MAC_BUF(mac); etherh_banner(); diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index d5c2d27f3ea4..f76b0b6c277d 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c @@ -13,16 +13,8 @@ * */ #include <linux/module.h> -#include <linux/types.h> -#include <linux/init.h> -#include <linux/errno.h> #include <linux/netdevice.h> -#include <linux/slab.h> -#include <linux/rtnetlink.h> -#include <linux/interrupt.h> -#include <linux/dma-mapping.h> #include <linux/platform_device.h> -#include <linux/pm.h> #include <linux/clk.h> #include <net/irda/irda.h> @@ -30,17 +22,9 @@ #include <net/irda/wrapper.h> #include <net/irda/irda_device.h> -#include <asm/irq.h> #include <asm/dma.h> -#include <asm/delay.h> -#include <asm/hardware.h> #include <asm/arch/irda.h> #include <asm/arch/pxa-regs.h> -#include <asm/arch/pxa2xx-gpio.h> - -#ifdef CONFIG_MACH_MAINSTONE -#include <asm/arch/mainstone.h> -#endif #define IrSR_RXPL_NEG_IS_ZERO (1<<4) #define IrSR_RXPL_POS_IS_ZERO 0x0 @@ -163,10 +147,6 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed) /* set board transceiver to SIR mode */ si->pdata->transceiver_mode(si->dev, IR_SIRMODE); - /* configure GPIO46/47 */ - pxa_gpio_mode(GPIO46_STRXD_MD); - pxa_gpio_mode(GPIO47_STTXD_MD); - /* enable the STUART clock */ pxa_irda_enable_sirclk(si); } @@ -201,10 +181,6 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed) /* set board transceiver to FIR mode */ si->pdata->transceiver_mode(si->dev, IR_FIRMODE); - /* configure GPIO46/47 */ - pxa_gpio_mode(GPIO46_ICPRXD_MD); - pxa_gpio_mode(GPIO47_ICPTXD_MD); - /* enable the FICP clock */ pxa_irda_enable_firclk(si); diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 1f4ca2b54a73..83625fdff3dd 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c @@ -39,6 +39,7 @@ #include <linux/if_arp.h> #include <linux/ip.h> #include <linux/tcp.h> +#include <linux/smp_lock.h> #include <linux/spinlock.h> #include <linux/rwsem.h> #include <linux/stddef.h> @@ -353,6 +354,7 @@ static const int npindex_to_ethertype[NUM_NP] = { */ static int ppp_open(struct inode *inode, struct file *file) { + cycle_kernel_lock(); /* * This could (should?) be enforced by the permissions on /dev/ppp. */ diff --git a/drivers/net/tun.c b/drivers/net/tun.c index b9018bfa0a97..eba1271b9735 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -48,6 +48,7 @@ #include <linux/kernel.h> #include <linux/major.h> #include <linux/slab.h> +#include <linux/smp_lock.h> #include <linux/poll.h> #include <linux/fcntl.h> #include <linux/init.h> @@ -802,22 +803,26 @@ static int tun_chr_fasync(int fd, struct file *file, int on) DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on); + lock_kernel(); if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0) - return ret; + goto out; if (on) { ret = __f_setown(file, task_pid(current), PIDTYPE_PID, 0); if (ret) - return ret; + goto out; tun->flags |= TUN_FASYNC; } else tun->flags &= ~TUN_FASYNC; - - return 0; + ret = 0; +out: + unlock_kernel(); + return ret; } static int tun_chr_open(struct inode *inode, struct file * file) { + cycle_kernel_lock(); DBG1(KERN_INFO "tunX: tun_chr_open\n"); file->private_data = NULL; return 0; diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index b0fce1387eaf..5827324e9d9f 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c @@ -92,6 +92,7 @@ #include <linux/spinlock.h> #include <linux/mutex.h> #include <linux/device.h> +#include <linux/smp_lock.h> #undef COSA_SLOW_IO /* for testing purposes only */ @@ -970,15 +971,21 @@ static int cosa_open(struct inode *inode, struct file *file) struct channel_data *chan; unsigned long flags; int n; + int ret = 0; + lock_kernel(); if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS) - >= nr_cards) - return -ENODEV; + >= nr_cards) { + ret = -ENODEV; + goto out; + } cosa = cosa_cards+n; if ((n=iminor(file->f_path.dentry->d_inode) - & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) - return -ENODEV; + & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) { + ret = -ENODEV; + goto out; + } chan = cosa->chan + n; file->private_data = chan; @@ -987,7 +994,8 @@ static int cosa_open(struct inode *inode, struct file *file) if (chan->usage < 0) { /* in netdev mode */ spin_unlock_irqrestore(&cosa->lock, flags); - return -EBUSY; + ret = -EBUSY; + goto out; } cosa->usage++; chan->usage++; @@ -996,7 +1004,9 @@ static int cosa_open(struct inode *inode, struct file *file) chan->setup_rx = chrdev_setup_rx; chan->rx_done = chrdev_rx_done; spin_unlock_irqrestore(&cosa->lock, flags); - return 0; +out: + unlock_kernel(); + return ret; } static int cosa_release(struct inode *inode, struct file *file) |