* kaweth_driver
****************************************************************/
static struct usb_driver kaweth_driver = {
+ owner: THIS_MODULE,
name: "kaweth",
probe: kaweth_probe,
disconnect: kaweth_disconnect,
return -EBUSY;
}
- dr = kmalloc(sizeof(struct usb_ctrlrequest),
- in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
+ dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
if (!dr) {
kaweth_dbg("kmalloc() failed");
{
struct kaweth_device *kaweth = urb->context;
- spin_lock(&kaweth->device_lock);
-
- if (urb->status)
+ if (unlikely(urb->status != 0))
kaweth_dbg("%s: TX status %d.", kaweth->net->name, urb->status);
netif_wake_queue(kaweth->net);
-
- spin_unlock(&kaweth->device_lock);
}
/****************************************************************
memset(kaweth, 0, sizeof(struct kaweth_device));
kaweth->dev = dev;
- kaweth->status = 0;
- kaweth->net = NULL;
- kaweth->device_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&kaweth->device_lock);
kaweth_dbg("Resetting.");
/* Device will now disappear for a moment... */
kaweth_info("Firmware loaded. I'll be back...");
+ kfree(kaweth);
return NULL;
}
kaweth_warn("unregistering non-existant device");
return;
}
+ usb_unlink_urb(kaweth->tx_urb);
+ usb_unlink_urb(kaweth->rx_urb);
if(kaweth->net) {
if(kaweth->net->flags & IFF_UP) {