From 48b7bf6e3d5ac3401b76b6ffd569386d3a67074d Mon Sep 17 00:00:00 2001 From: juhosg Date: Fri, 20 Jul 2007 09:07:18 +0000 Subject: [adm5120] fix switch_driver to avoid segfaults git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8071 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'target/linux/adm5120-2.6/files') diff --git a/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c b/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c index 83a311fb9..744a2da35 100644 --- a/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c +++ b/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c @@ -262,7 +262,7 @@ static int adm5120_sw_open(struct net_device *dev) { unsigned long val; int i; - + netif_start_queue(dev); if (!adm5120_if_open++) { /* enable interrupts on first open */ @@ -284,7 +284,7 @@ static int adm5120_sw_stop(struct net_device *dev) { unsigned long val; int i; - + if (!--adm5120_if_open) { adm5120_set_reg(ADM5120_INT_MASK, ADM5120_INTMASKALL); } @@ -321,7 +321,7 @@ static int adm5120_sw_tx(struct sk_buff *skb, struct net_device *dev) dma->status = ((skb->lenlen) << ADM5120_DMA_LENSHIFT) | (0x1 << priv->port); - + dma->len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; priv->stats.tx_packets++; priv->stats.tx_bytes += skb->len; @@ -554,7 +554,7 @@ static int __init adm5120_sw_init(void) adm5120_set_reg(ADM5120_RECEIVE_HBADDR, KSEG1ADDR(adm5120_dma_rxh)); adm5120_set_reg(ADM5120_RECEIVE_LBADDR, KSEG1ADDR(adm5120_dma_rxl)); - for (i=0; i