patch-2.3.18 linux/drivers/usb/ohci.c
Next file: linux/drivers/usb/printer.c
Previous file: linux/drivers/usb/ohci-root-hub.c
Back to the patch index
Back to the overall index
- Lines: 55
- Date:
Fri Sep 10 12:59:49 1999
- Orig file:
v2.3.17/linux/drivers/usb/ohci.c
- Orig date:
Tue Sep 7 12:14:07 1999
diff -u --recursive --new-file v2.3.17/linux/drivers/usb/ohci.c linux/drivers/usb/ohci.c
@@ -37,8 +37,8 @@
#include <linux/malloc.h>
#include <linux/smp_lock.h>
#include <linux/errno.h>
+#include <linux/spinlock.h>
-#include <asm/spinlock.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/system.h>
@@ -943,11 +943,12 @@
* Period is desired polling interval in ms. The closest, shorter
* match will be used. Powers of two from 1-32 are supported by OHCI.
*
- * Returns: a "handle pointer" that release_irq can use to stop this
- * interrupt. (It's really a pointer to the TD). NULL = error.
+ * Returns: success (0) or failure (< 0).
+ * Also sets the "handle pointer" that release_irq can use to stop this
+ * interrupt. (It's really a pointer to the TD).
*/
-static void* ohci_request_irq(struct usb_device *usb, unsigned int pipe,
- usb_device_irq handler, int period, void *dev_id)
+static int ohci_request_irq(struct usb_device *usb, unsigned int pipe,
+ usb_device_irq handler, int period, void *dev_id, void **handle)
{
struct ohci_device *dev = usb_to_ohci(usb);
struct ohci_td *td;
@@ -961,7 +962,7 @@
interrupt_ed = ohci_get_free_ed(dev);
if (!interrupt_ed) {
printk(KERN_ERR "Out of EDs on device %p in ohci_request_irq\n", dev);
- return NULL;
+ return (-ENOMEM);
}
/*
@@ -988,7 +989,7 @@
if (!td) {
printk(KERN_ERR "Out of TDs in ohci_request_irq\n");
ohci_free_ed(interrupt_ed);
- return NULL;
+ return (-ENOMEM);
}
/* Fill in the TD */
@@ -1009,7 +1010,8 @@
td = ohci_add_tds_to_ed(td, interrupt_ed);
spin_unlock_irqrestore(&ohci_edtd_lock, flags);
- return (void*)td;
+ *handle = (void*)td;
+ return 0;
} /* ohci_request_irq() */
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)