include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[linux-2.6-block.git] / drivers / net / wireless / zd1211rw / zd_usb.c
index 72d3e437e1905f674548099f6d9bf22dcb8d1bff..d91ad1a612afd23ef64a0045cc41e70ce99537f8 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/firmware.h>
 #include <linux/device.h>
 #include <linux/errno.h>
+#include <linux/slab.h>
 #include <linux/skbuff.h>
 #include <linux/usb.h>
 #include <linux/workqueue.h>
@@ -1079,11 +1080,15 @@ static int eject_installer(struct usb_interface *intf)
        int r;
 
        /* Find bulk out endpoint */
-       endpoint = &iface_desc->endpoint[1].desc;
-       if (usb_endpoint_dir_out(endpoint) &&
-           usb_endpoint_xfer_bulk(endpoint)) {
-               bulk_out_ep = endpoint->bEndpointAddress;
-       } else {
+       for (r = 1; r >= 0; r--) {
+               endpoint = &iface_desc->endpoint[r].desc;
+               if (usb_endpoint_dir_out(endpoint) &&
+                   usb_endpoint_xfer_bulk(endpoint)) {
+                       bulk_out_ep = endpoint->bEndpointAddress;
+                       break;
+               }
+       }
+       if (r == -1) {
                dev_err(&udev->dev,
                        "zd1211rw: Could not find bulk out endpoint\n");
                return -ENODEV;