Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303713
b: refs/heads/master
c: 7a2d281
h: refs/heads/master
i:
  303711: 955bda0
v: v3
  • Loading branch information
Greg Kroah-Hartman committed May 2, 2012
1 parent 1464d84 commit 6271086
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d8ec7a7c1c2139ace5b8da79600bcef756e0b349
refs/heads/master: 7a2d281060fad7ef9220b8c051da38eae6c5f366
34 changes: 19 additions & 15 deletions trunk/drivers/usb/misc/uss720.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ static void destroy_priv(struct kref *kref)
{
struct parport_uss720_private *priv = container_of(kref, struct parport_uss720_private, ref_count);

dev_dbg(&priv->usbdev->dev, "destroying priv datastructure\n");
usb_put_dev(priv->usbdev);
kfree(priv);
dbg("destroying priv datastructure");
}

static void destroy_async(struct kref *kref)
Expand Down Expand Up @@ -123,10 +123,12 @@ static void async_complete(struct urb *urb)
} else if (rq->dr.bRequest == 3) {
memcpy(priv->reg, rq->reg, sizeof(priv->reg));
#if 0
dbg("async_complete regs %02x %02x %02x %02x %02x %02x %02x",
(unsigned int)priv->reg[0], (unsigned int)priv->reg[1], (unsigned int)priv->reg[2],
(unsigned int)priv->reg[3], (unsigned int)priv->reg[4], (unsigned int)priv->reg[5],
(unsigned int)priv->reg[6]);
dev_dbg(&priv->usbdev->dev,
"async_complete regs %02x %02x %02x %02x %02x %02x %02x\n",
(unsigned int)priv->reg[0], (unsigned int)priv->reg[1],
(unsigned int)priv->reg[2], (unsigned int)priv->reg[3],
(unsigned int)priv->reg[4], (unsigned int)priv->reg[5],
(unsigned int)priv->reg[6]);
#endif
/* if nAck interrupts are enabled and we have an interrupt, call the interrupt procedure */
if (rq->reg[2] & rq->reg[1] & 0x10 && pp)
Expand Down Expand Up @@ -693,17 +695,17 @@ static int uss720_probe(struct usb_interface *intf,
unsigned char reg;
int i;

dbg("probe: vendor id 0x%x, device id 0x%x\n",
le16_to_cpu(usbdev->descriptor.idVendor),
le16_to_cpu(usbdev->descriptor.idProduct));
dev_dbg(&intf->dev, "probe: vendor id 0x%x, device id 0x%x\n",
le16_to_cpu(usbdev->descriptor.idVendor),
le16_to_cpu(usbdev->descriptor.idProduct));

/* our known interfaces have 3 alternate settings */
if (intf->num_altsetting != 3) {
usb_put_dev(usbdev);
return -ENODEV;
}
i = usb_set_interface(usbdev, intf->altsetting->desc.bInterfaceNumber, 2);
dbg("set inteface result %d", i);
dev_dbg(&intf->dev, "set inteface result %d\n", i);

interface = intf->cur_altsetting;

Expand Down Expand Up @@ -734,11 +736,13 @@ static int uss720_probe(struct usb_interface *intf,
set_1284_register(pp, 2, 0x0c, GFP_KERNEL);
/* debugging */
get_1284_register(pp, 0, &reg, GFP_KERNEL);
dbg("reg: %02x %02x %02x %02x %02x %02x %02x",
priv->reg[0], priv->reg[1], priv->reg[2], priv->reg[3], priv->reg[4], priv->reg[5], priv->reg[6]);
dev_dbg(&intf->dev, "reg: %02x %02x %02x %02x %02x %02x %02x\n",
priv->reg[0], priv->reg[1], priv->reg[2], priv->reg[3],
priv->reg[4], priv->reg[5], priv->reg[6]);

endpoint = &interface->endpoint[2];
dbg("epaddr %d interval %d", endpoint->desc.bEndpointAddress, endpoint->desc.bInterval);
dev_dbg(&intf->dev, "epaddr %d interval %d\n",
endpoint->desc.bEndpointAddress, endpoint->desc.bInterval);
parport_announce_port(pp);

usb_set_intfdata(intf, pp);
Expand All @@ -756,20 +760,20 @@ static void uss720_disconnect(struct usb_interface *intf)
struct parport_uss720_private *priv;
struct usb_device *usbdev;

dbg("disconnect");
dev_dbg(&intf->dev, "disconnect\n");
usb_set_intfdata(intf, NULL);
if (pp) {
priv = pp->private_data;
usbdev = priv->usbdev;
priv->usbdev = NULL;
priv->pp = NULL;
dbg("parport_remove_port");
dev_dbg(&intf->dev, "parport_remove_port\n");
parport_remove_port(pp);
parport_put_port(pp);
kill_all_async_requests_priv(priv);
kref_put(&priv->ref_count, destroy_priv);
}
dbg("disconnect done");
dev_dbg(&intf->dev, "disconnect done\n");
}

/* table of cables that work through this driver */
Expand Down

0 comments on commit 6271086

Please sign in to comment.