static act2000_card *irq2card_map[16];
-static void
-act2000_isa_delay(long t)
-{
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(t);
-}
-
/*
* Reset Controller, then try to read the Card's signature.
+ Return:
if (!act2000_isa_reset(card->port))
return -ENXIO;
- act2000_isa_delay(HZ / 2);
+ msleep_interruptible(500);
if(copy_from_user(&cblock, cb, sizeof(cblock)))
return -EFAULT;
length = cblock.length;
l = (length > 1024) ? 1024 : length;
c = 0;
b = buf;
- copy_from_user(buf, p, l);
+ if (copy_from_user(buf, p, l)) {
+ kfree(buf);
+ return -EFAULT;
+ }
while (c < l) {
if (act2000_isa_writeb(card, *b++)) {
printk(KERN_WARNING
p += l;
}
kfree(buf);
- act2000_isa_delay(HZ / 2);
+ msleep_interruptible(500);
return (act2000_isa_getid(card));
}