aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2011-03-22 06:12:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-13 19:18:31 -0400
commitdab54c9f1e26f47a3313300bc1f4dc0eecb47375 (patch)
treec14b03918f85d1979853227975ec53d0fe9f3132 /drivers/usb/class
parent6fb6b8846458afb7b5689f86cf35705c40eb70e5 (diff)
USB: cdc-acm: clean up rx_buflimit references
Clean up references to rx_buflimit. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/cdc-acm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index e0f9febee7e6..2d8d6b838235 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -606,16 +606,15 @@ early_bail:
606 606
607static void acm_tty_unregister(struct acm *acm) 607static void acm_tty_unregister(struct acm *acm)
608{ 608{
609 int i, nr; 609 int i;
610 610
611 nr = acm->rx_buflimit;
612 tty_unregister_device(acm_tty_driver, acm->minor); 611 tty_unregister_device(acm_tty_driver, acm->minor);
613 usb_put_intf(acm->control); 612 usb_put_intf(acm->control);
614 acm_table[acm->minor] = NULL; 613 acm_table[acm->minor] = NULL;
615 usb_free_urb(acm->ctrlurb); 614 usb_free_urb(acm->ctrlurb);
616 for (i = 0; i < ACM_NW; i++) 615 for (i = 0; i < ACM_NW; i++)
617 usb_free_urb(acm->wb[i].urb); 616 usb_free_urb(acm->wb[i].urb);
618 for (i = 0; i < nr; i++) 617 for (i = 0; i < acm->rx_buflimit; i++)
619 usb_free_urb(acm->ru[i].urb); 618 usb_free_urb(acm->ru[i].urb);
620 kfree(acm->country_codes); 619 kfree(acm->country_codes);
621 kfree(acm); 620 kfree(acm);
@@ -623,7 +622,8 @@ static void acm_tty_unregister(struct acm *acm)
623 622
624static void acm_port_down(struct acm *acm) 623static void acm_port_down(struct acm *acm)
625{ 624{
626 int i, nr = acm->rx_buflimit; 625 int i;
626
627 mutex_lock(&open_mutex); 627 mutex_lock(&open_mutex);
628 if (acm->dev) { 628 if (acm->dev) {
629 usb_autopm_get_interface(acm->control); 629 usb_autopm_get_interface(acm->control);
@@ -632,7 +632,7 @@ static void acm_port_down(struct acm *acm)
632 for (i = 0; i < ACM_NW; i++) 632 for (i = 0; i < ACM_NW; i++)
633 usb_kill_urb(acm->wb[i].urb); 633 usb_kill_urb(acm->wb[i].urb);
634 tasklet_disable(&acm->urb_task); 634 tasklet_disable(&acm->urb_task);
635 for (i = 0; i < nr; i++) 635 for (i = 0; i < acm->rx_buflimit; i++)
636 usb_kill_urb(acm->ru[i].urb); 636 usb_kill_urb(acm->ru[i].urb);
637 tasklet_enable(&acm->urb_task); 637 tasklet_enable(&acm->urb_task);
638 acm->control->needs_remote_wakeup = 0; 638 acm->control->needs_remote_wakeup = 0;
@@ -882,9 +882,9 @@ static void acm_write_buffers_free(struct acm *acm)
882static void acm_read_buffers_free(struct acm *acm) 882static void acm_read_buffers_free(struct acm *acm)
883{ 883{
884 struct usb_device *usb_dev = interface_to_usbdev(acm->control); 884 struct usb_device *usb_dev = interface_to_usbdev(acm->control);
885 int i, n = acm->rx_buflimit; 885 int i;
886 886
887 for (i = 0; i < n; i++) 887 for (i = 0; i < acm->rx_buflimit; i++)
888 usb_free_coherent(usb_dev, acm->readsize, 888 usb_free_coherent(usb_dev, acm->readsize,
889 acm->rb[i].base, acm->rb[i].dma); 889 acm->rb[i].base, acm->rb[i].dma);
890} 890}