aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/uss720.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-03-17 06:35:44 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-23 08:54:03 -0400
commit9fdc1c6fdfa0bdf1854c3c06f002e6a76155fa2b (patch)
tree4a1e315b60b3459eb62a5fd82b976e8f0ca793b2 /drivers/usb/misc/uss720.c
parentaac96ef9ed3aba10d97cbc5afaf79365701a2f14 (diff)
USB: uss720: add debug endpoint-type check
Use the new endpoint helpers to lookup the interrupt-in endpoint, and only print the corresponding debugging information in case it is found. Note that the descriptors are searched in reverse order to avoid any regressions. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/uss720.c')
-rw-r--r--drivers/usb/misc/uss720.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c
index e45a3a680db8..00ce314d89e7 100644
--- a/drivers/usb/misc/uss720.c
+++ b/drivers/usb/misc/uss720.c
@@ -689,7 +689,7 @@ static int uss720_probe(struct usb_interface *intf,
689{ 689{
690 struct usb_device *usbdev = usb_get_dev(interface_to_usbdev(intf)); 690 struct usb_device *usbdev = usb_get_dev(interface_to_usbdev(intf));
691 struct usb_host_interface *interface; 691 struct usb_host_interface *interface;
692 struct usb_host_endpoint *endpoint; 692 struct usb_endpoint_descriptor *epd;
693 struct parport_uss720_private *priv; 693 struct parport_uss720_private *priv;
694 struct parport *pp; 694 struct parport *pp;
695 unsigned char reg; 695 unsigned char reg;
@@ -740,9 +740,11 @@ static int uss720_probe(struct usb_interface *intf,
740 get_1284_register(pp, 0, &reg, GFP_KERNEL); 740 get_1284_register(pp, 0, &reg, GFP_KERNEL);
741 dev_dbg(&intf->dev, "reg: %7ph\n", priv->reg); 741 dev_dbg(&intf->dev, "reg: %7ph\n", priv->reg);
742 742
743 endpoint = &interface->endpoint[2]; 743 i = usb_find_last_int_in_endpoint(interface, &epd);
744 dev_dbg(&intf->dev, "epaddr %d interval %d\n", 744 if (!i) {
745 endpoint->desc.bEndpointAddress, endpoint->desc.bInterval); 745 dev_dbg(&intf->dev, "epaddr %d interval %d\n",
746 epd->bEndpointAddress, epd->bInterval);
747 }
746 parport_announce_port(pp); 748 parport_announce_port(pp);
747 749
748 usb_set_intfdata(intf, pp); 750 usb_set_intfdata(intf, pp);