summaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2016-11-18 19:06:10 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-21 11:36:15 +0100
commite46146069bf60bb2b5c135bb132a1c0d1f905f4a (patch)
tree7199eeefccf25fa2fe69c5fa5239f6abc0ef8266 /drivers/usb/class
parentcdc-acm: reindent log messages (diff)
downloadlinux-e46146069bf60bb2b5c135bb132a1c0d1f905f4a.tar.xz
linux-e46146069bf60bb2b5c135bb132a1c0d1f905f4a.zip
cdc-acm: avoid interface_to_usbdev call
Pointer to usb_device is already stored in acm structure. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/cdc-acm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 9ae94bc7a1be..464ca905e4d7 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1076,19 +1076,17 @@ static void acm_write_buffers_free(struct acm *acm)
{
int i;
struct acm_wb *wb;
- struct usb_device *usb_dev = interface_to_usbdev(acm->control);
for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++)
- usb_free_coherent(usb_dev, acm->writesize, wb->buf, wb->dmah);
+ usb_free_coherent(acm->dev, acm->writesize, wb->buf, wb->dmah);
}
static void acm_read_buffers_free(struct acm *acm)
{
- struct usb_device *usb_dev = interface_to_usbdev(acm->control);
int i;
for (i = 0; i < acm->rx_buflimit; i++)
- usb_free_coherent(usb_dev, acm->readsize,
+ usb_free_coherent(acm->dev, acm->readsize,
acm->read_buffers[i].base, acm->read_buffers[i].dma);
}
@@ -1524,7 +1522,6 @@ static void stop_data_traffic(struct acm *acm)
static void acm_disconnect(struct usb_interface *intf)
{
struct acm *acm = usb_get_intfdata(intf);
- struct usb_device *usb_dev = interface_to_usbdev(intf);
struct tty_struct *tty;
int i;
@@ -1562,7 +1559,7 @@ static void acm_disconnect(struct usb_interface *intf)
for (i = 0; i < acm->rx_buflimit; i++)
usb_free_urb(acm->read_urbs[i]);
acm_write_buffers_free(acm);
- usb_free_coherent(usb_dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
+ usb_free_coherent(acm->dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
acm_read_buffers_free(acm);
if (!acm->combined_interfaces)