cdc-acm: use swap() in acm_probe()
authorFabian Frederick <fabf@skynet.be>
Mon, 18 May 2015 17:59:37 +0000 (19:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 16:30:07 +0000 (09:30 -0700)
Use kernel.h macro definition.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c

index 877b637e7f7b614085164490a289fe6561e3266c..eb22a0608033b3d126b711a38056957f85b8af0b 100644 (file)
@@ -1263,12 +1263,9 @@ skip_normal_probe:
                                                != CDC_DATA_INTERFACE_TYPE) {
                if (control_interface->cur_altsetting->desc.bInterfaceClass
                                                == CDC_DATA_INTERFACE_TYPE) {
-                       struct usb_interface *t;
                        dev_dbg(&intf->dev,
                                "Your device has switched interfaces.\n");
-                       t = control_interface;
-                       control_interface = data_interface;
-                       data_interface = t;
+                       swap(control_interface, data_interface);
                } else {
                        return -EINVAL;
                }
@@ -1297,12 +1294,9 @@ skip_normal_probe:
        /* workaround for switched endpoints */
        if (!usb_endpoint_dir_in(epread)) {
                /* descriptors are swapped */
-               struct usb_endpoint_descriptor *t;
                dev_dbg(&intf->dev,
                        "The data interface has switched endpoints\n");
-               t = epread;
-               epread = epwrite;
-               epwrite = t;
+               swap(epread, epwrite);
        }
 made_compressed_probe:
        dev_dbg(&intf->dev, "interfaces are valid\n");