]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usbtmc: Add, clarify and fix comments
authorDave Penkler <dpenkler@gmail.com>
Wed, 28 Sep 2016 18:06:01 +0000 (20:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2016 12:36:25 +0000 (14:36 +0200)
Add information regarding lifespan of kref protection:
   Clarify comment on kref_get for interrupt in urb in usbtmc_probe()
   Add comment on kref_get in usbtmc_open()

Fix endpoint reference in documentation for send_request_dev_dep_msg_in()

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/usbtmc.c

index a6c1fae7d52a4d824812b50553df682900f4523f..f03692ec552056845c6fa50947e38abca47ea66b 100644 (file)
@@ -157,6 +157,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp)
        }
 
        data = usb_get_intfdata(intf);
+       /* Protect reference to data from file structure until release */
        kref_get(&data->kref);
 
        /* Store pointer in file structure's private data field */
@@ -531,7 +532,7 @@ static int usbtmc488_ioctl_simple(struct usbtmc_device_data *data,
 }
 
 /*
- * Sends a REQUEST_DEV_DEP_MSG_IN message on the Bulk-IN endpoint.
+ * Sends a REQUEST_DEV_DEP_MSG_IN message on the Bulk-OUT endpoint.
  * @transfer_size: number of bytes to request from the device.
  *
  * See the USBTMC specification, Table 4.
@@ -1471,7 +1472,7 @@ static int usbtmc_probe(struct usb_interface *intf,
                if (!data->iin_urb)
                        goto error_register;
 
-               /* will reference data in int urb */
+               /* Protect interrupt in endpoint data until iin_urb is freed */
                kref_get(&data->kref);
 
                /* allocate buffer for interrupt in */