]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: move ap_disconnect()
authorAlex Elder <elder@linaro.org>
Mon, 20 Oct 2014 15:27:59 +0000 (10:27 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 20 Oct 2014 22:28:24 +0000 (06:28 +0800)
The next patch has ap_probe() reference ap_disconnect().  To prepare
for that, move ap_disconnect() up in the file.

This is done as a separate commit to make it easier to see this move
involves no other change to that function.  This and the next commit
can be squashed if desired.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/es1-ap-usb.c

index 21db78fb863f07239e7db9e2495ddcc76994f4d5..4473c9af97c6b69f0cfb6829a421b4e040bfea16 100644 (file)
@@ -266,6 +266,35 @@ static int check_urb_status(struct urb *urb)
        return -EAGAIN;
 }
 
+static void ap_disconnect(struct usb_interface *interface)
+{
+       struct es1_ap_dev *es1;
+       int i;
+
+       es1 = usb_get_intfdata(interface);
+       if (!es1)
+               return;
+
+       /* Tear down everything! */
+       for (i = 0; i < NUM_CPORT_OUT_URB; ++i) {
+               usb_kill_urb(es1->cport_out_urb[i]);
+               usb_free_urb(es1->cport_out_urb[i]);
+       }
+
+       for (i = 0; i < NUM_CPORT_IN_URB; ++i) {
+               usb_kill_urb(es1->cport_in_urb[i]);
+               usb_free_urb(es1->cport_in_urb[i]);
+               kfree(es1->cport_in_buffer[i]);
+       }
+
+       usb_kill_urb(es1->svc_urb);
+       usb_free_urb(es1->svc_urb);
+       usb_put_dev(es1->usb_dev);
+       kfree(es1->svc_buffer);
+       greybus_remove_hd(es1->hd);
+       usb_set_intfdata(interface, NULL);
+}
+
 /* Callback for when we get a SVC message */
 static void svc_in_callback(struct urb *urb)
 {
@@ -503,35 +532,6 @@ error:
        return retval;
 }
 
-static void ap_disconnect(struct usb_interface *interface)
-{
-       struct es1_ap_dev *es1;
-       int i;
-
-       es1 = usb_get_intfdata(interface);
-       if (!es1)
-               return;
-
-       /* Tear down everything! */
-       for (i = 0; i < NUM_CPORT_OUT_URB; ++i) {
-               usb_kill_urb(es1->cport_out_urb[i]);
-               usb_free_urb(es1->cport_out_urb[i]);
-       }
-
-       for (i = 0; i < NUM_CPORT_IN_URB; ++i) {
-               usb_kill_urb(es1->cport_in_urb[i]);
-               usb_free_urb(es1->cport_in_urb[i]);
-               kfree(es1->cport_in_buffer[i]);
-       }
-
-       usb_kill_urb(es1->svc_urb);
-       usb_free_urb(es1->svc_urb);
-       usb_put_dev(es1->usb_dev);
-       kfree(es1->svc_buffer);
-       greybus_remove_hd(es1->hd);
-       usb_set_intfdata(interface, NULL);
-}
-
 static struct usb_driver es1_ap_driver = {
        .name =         "es1_ap_driver",
        .probe =        ap_probe,