Skip to content

Commit

Permalink
cdc-acm: use swap() in acm_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fabian Frederick authored and Greg Kroah-Hartman committed May 24, 2015
1 parent 65c35dd commit 2cfef79
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,12 +1263,9 @@ static int acm_probe(struct usb_interface *intf,
!= 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;
}
Expand Down Expand Up @@ -1297,12 +1294,9 @@ static int acm_probe(struct usb_interface *intf,
/* 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");
Expand Down

0 comments on commit 2cfef79

Please sign in to comment.