summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-05-18 19:59:37 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 18:30:07 +0200
commit2cfef79ddce42e9604293424381b2e59913f600c (patch)
tree0ec3573282be2049cb23e2bc6e9eb61055d23356
parentUSB: cdc-acm: add support for up to 256 devices (diff)
downloadlinux-2cfef79ddce42e9604293424381b2e59913f600c.tar.xz
linux-2cfef79ddce42e9604293424381b2e59913f600c.zip
cdc-acm: use swap() in acm_probe()
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>
-rw-r--r--drivers/usb/class/cdc-acm.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 877b637e7f7b..eb22a0608033 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -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");