[PATCH 001/008] [RESUBMIT2] USB: serial: adding sierra_release_urb() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: [PATCH 001/008] [RESUBMIT2] USB: serial:  adding sierra_release_urb()
function
From: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx>

The following is summary of changes we have made to sierra.c driver in
[PATCH 001/008] from the series dealing with improving urb handling:
- Added function sierra_release_urb() to free an urb and its transfer buffer.
This function is to be called by sierra_close() in subsequent patch.
- Removed unecessary include file reference and comment
Signed-off-by: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx>
---

 drivers/usb/serial/sierra.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

--- a/drivers/usb/serial/sierra.c	2009-05-22 13:33:26.000000000 -0700
+++ b/drivers/usb/serial/sierra.c	2009-05-22 13:39:38.000000000 -0700
@@ -29,12 +29,10 @@
 #include <linux/module.h>
 #include <linux/usb.h>
 #include <linux/usb/serial.h>
-#include <linux/usb/ch9.h>
 
 #define SWIMS_USB_REQUEST_SetPower	0x00
 #define SWIMS_USB_REQUEST_SetNmea	0x07
 
-/* per port private data */
 #define N_IN_URB	8
 #define N_OUT_URB	64
 #define IN_BUFLEN	4096
@@ -370,6 +368,17 @@ static int sierra_tiocmset(struct tty_st
 	return sierra_send_setup(port);
 }
 
+static void sierra_release_urb(struct urb *urb)
+{
+	struct usb_serial_port *port;
+	if (urb) {
+		port =  urb->context;
+		dev_dbg(&port->dev, "%s: %p\n", __func__, urb);
+		kfree(urb->transfer_buffer);
+		usb_free_urb(urb);
+	}
+}
+
 static void sierra_outdat_callback(struct urb *urb)
 {
 	struct usb_serial_port *port = urb->context;



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux