X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Fappletalk%2Fltpc.c;h=2ea44ce4981064ed0589918a9b1ded3a45a7d793;hb=refs%2Fheads%2Fvserver;hp=cc7476f1c04199cbe87d6d625cf0b92e369ef92d;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c index cc7476f1c..2ea44ce49 100644 --- a/drivers/net/appletalk/ltpc.c +++ b/drivers/net/appletalk/ltpc.c @@ -227,17 +227,17 @@ static int dma; #include #include #include +#include #include -#include #include #include /* our stuff */ #include "ltpc.h" -static spinlock_t txqueue_lock = SPIN_LOCK_UNLOCKED; -static spinlock_t mbox_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(txqueue_lock); +static DEFINE_SPINLOCK(mbox_lock); /* function prototypes */ static int do_read(struct net_device *dev, void *cbuf, int cbuflen, @@ -501,7 +501,7 @@ static void idle(struct net_device *dev) /* FIXME This is initialized to shut the warning up, but I need to * think this through again. */ - struct xmitQel *q=0; + struct xmitQel *q = NULL; int oops; int i; int base = dev->base_addr; @@ -790,7 +790,7 @@ static int sendup_buffer (struct net_device *dev) /* the handler for the board interrupt */ static irqreturn_t -ltpc_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr) +ltpc_interrupt(int irq, void *dev_id) { struct net_device *dev = dev_id; @@ -1039,7 +1039,7 @@ struct net_device * __init ltpc_probe(void) unsigned long f; unsigned long timeout; - dev = alloc_netdev(sizeof(struct ltpc_private), "lt%d", ltalk_setup); + dev = alloc_ltalkdev(sizeof(struct ltpc_private)); if (!dev) goto out; @@ -1109,8 +1109,7 @@ struct net_device * __init ltpc_probe(void) inb_p(io+1); inb_p(io+3); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(2*HZ/100); + msleep(20); inb_p(io+0); inb_p(io+2); @@ -1120,8 +1119,7 @@ struct net_device * __init ltpc_probe(void) inb_p(io+5); /* enable dma */ inb_p(io+6); /* tri-state interrupt line */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ); + ssleep(1); /* now, figure out which dma channel we're using, unless it's already been specified */ @@ -1203,7 +1201,7 @@ struct net_device * __init ltpc_probe(void) if (err) goto out4; - return 0; + return NULL; out4: del_timer_sync(<pc_timer); if (dev->irq) @@ -1257,10 +1255,10 @@ static struct net_device *dev_ltpc; #ifdef MODULE MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "i"); -MODULE_PARM(io, "i"); -MODULE_PARM(irq, "i"); -MODULE_PARM(dma, "i"); +module_param(debug, int, 0); +module_param(io, int, 0); +module_param(irq, int, 0); +module_param(dma, int, 0); int __init init_module(void)