[PATCH 1/1] USB: serial: sierra driver debug info visibility improvement

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

 



Subject: [PATCH 1/1] USB: serial: sierra driver debug info visibility
improvement
From: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx>


The following is summary of changes we have made to sierra.c driver in
[PATCH 1/1] dealing with debug information visibility improvements:
- Version number set to 1.3.5
- Added "\n" at the end of each string in dev_dbg() code to improve the debug 
information visibility. Without this change the debug logs are very difficult 
to read.
Signed-off-by: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx>
---
 drivers/usb/serial/sierra.c |   56 ++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 28 deletions(-)

--- a/drivers/usb/serial/sierra.c	2009-04-27 17:27:42.000000000 -0700
+++ b/drivers/usb/serial/sierra.c	2009-04-27 17:59:46.000000000 -0700
@@ -14,7 +14,7 @@
   Whom based his on the Keyspan driver by Hugh Blemings <hugh@xxxxxxxxxxxx>
 */
 
-#define DRIVER_VERSION "v.1.3.4"
+#define DRIVER_VERSION "v.1.3.5"
 #define DRIVER_AUTHOR "Kevin Lloyd <klloyd@xxxxxxxxxxxxxxxxxx>"
 #define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
 
@@ -42,7 +42,7 @@ static int nmea;
 static int sierra_set_power_state(struct usb_device *udev, __u16 swiState)
 {
 	int result;
-	dev_dbg(&udev->dev, "%s", __func__);
+	dev_dbg(&udev->dev, "%s\n", __func__);
 	result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
 			SWIMS_USB_REQUEST_SetPower,	/* __u8 request      */
 			USB_TYPE_VENDOR,		/* __u8 request type */
@@ -57,7 +57,7 @@ static int sierra_set_power_state(struct
 static int sierra_vsc_set_nmea(struct usb_device *udev, __u16 enable)
 {
 	int result;
-	dev_dbg(&udev->dev, "%s", __func__);
+	dev_dbg(&udev->dev, "%s\n", __func__);
 	result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
 			SWIMS_USB_REQUEST_SetNmea,	/* __u8 request      */
 			USB_TYPE_VENDOR,		/* __u8 request type */
@@ -73,7 +73,7 @@ static int sierra_calc_num_ports(struct 
 {
 	int result;
 	int *num_ports = usb_get_serial_data(serial);
-	dev_dbg(&serial->dev->dev, "%s", __func__);
+	dev_dbg(&serial->dev->dev, "%s\n", __func__);
 
 	result = *num_ports;
 
@@ -90,7 +90,7 @@ static int sierra_calc_interface(struct 
 	int interface;
 	struct usb_interface *p_interface;
 	struct usb_host_interface *p_host_interface;
-	dev_dbg(&serial->dev->dev, "%s", __func__);
+	dev_dbg(&serial->dev->dev, "%s\n", __func__);
 
 	/* Get the interface structure pointer from the serial struct */
 	p_interface = serial->interface;
@@ -115,7 +115,7 @@ static int sierra_probe(struct usb_seria
 	u8 ifnum;
 	u8 numendpoints;
 
-	dev_dbg(&serial->dev->dev, "%s", __func__);
+	dev_dbg(&serial->dev->dev, "%s\n", __func__);
 
 	num_ports = kmalloc(sizeof(*num_ports), GFP_KERNEL);
 	if (!num_ports)
@@ -247,7 +247,7 @@ static int sierra_send_setup(struct usb_
 	__u16 interface = 0;
 	int val = 0;
 
-	dev_dbg(&port->dev, "%s", __func__);
+	dev_dbg(&port->dev, "%s\n", __func__);
 
 	portdata = usb_get_serial_port_data(port);
 
@@ -294,7 +294,7 @@ static int sierra_send_setup(struct usb_
 static void sierra_set_termios(struct tty_struct *tty,
 		struct usb_serial_port *port, struct ktermios *old_termios)
 {
-	dev_dbg(&port->dev, "%s", __func__);
+	dev_dbg(&port->dev, "%s\n", __func__);
 	tty_termios_copy_hw(tty->termios, old_termios);
 	sierra_send_setup(port);
 }
@@ -305,7 +305,7 @@ static int sierra_tiocmget(struct tty_st
 	unsigned int value;
 	struct sierra_port_private *portdata;
 
-	dev_dbg(&port->dev, "%s", __func__);
+	dev_dbg(&port->dev, "%s\n", __func__);
 	portdata = usb_get_serial_port_data(port);
 
 	value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
@@ -345,14 +345,14 @@ static void sierra_outdat_callback(struc
 	int status = urb->status;
 	unsigned long flags;
 
-	dev_dbg(&port->dev, "%s - port %d", __func__, port->number);
+	dev_dbg(&port->dev, "%s - port %d\n", __func__, port->number);
 
 	/* free up the transfer buffer, as usb_free_urb() does not do this */
 	kfree(urb->transfer_buffer);
 
 	if (status)
 		dev_dbg(&port->dev, "%s - nonzero write bulk status "
-		    "received: %d", __func__, status);
+		    "received: %d\n", __func__, status);
 
 	spin_lock_irqsave(&portdata->lock, flags);
 	--portdata->outstanding_urbs;
@@ -374,7 +374,7 @@ static int sierra_write(struct tty_struc
 
 	portdata = usb_get_serial_port_data(port);
 
-	dev_dbg(&port->dev, "%s: write (%d chars)", __func__, count);
+	dev_dbg(&port->dev, "%s: write (%d chars)\n", __func__, count);
 
 	spin_lock_irqsave(&portdata->lock, flags);
 	if (portdata->outstanding_urbs > N_OUT_URB) {
@@ -449,7 +449,7 @@ static void sierra_indat_callback(struct
 
 	if (status) {
 		dev_dbg(&port->dev, "%s: nonzero status: %d on"
-		    " endpoint %02x.", __func__, status, endpoint);
+			" endpoint %02x\n", __func__, status, endpoint);
 	} else {
 		if (urb->actual_length) {
 			tty = tty_port_tty_get(&port->port);
@@ -459,7 +459,7 @@ static void sierra_indat_callback(struct
 			tty_kref_put(tty);
 		} else
 			dev_dbg(&port->dev, "%s: empty read urb"
-				" received", __func__);
+				" received\n", __func__);
 
 		/* Resubmit urb so we continue receiving */
 		if (port->port.count && status != -ESHUTDOWN) {
@@ -480,8 +480,8 @@ static void sierra_instat_callback(struc
 	struct sierra_port_private *portdata = usb_get_serial_port_data(port);
 	struct usb_serial *serial = port->serial;
 
-	dev_dbg(&port->dev, "%s", __func__);
-	dev_dbg(&port->dev, "%s: urb %p port %p has data %p", __func__,
+	dev_dbg(&port->dev, "%s\n", __func__);
+	dev_dbg(&port->dev, "%s: urb %p port %p has data %p\n", __func__,
 		urb, port, portdata);
 
 	if (status == 0) {
@@ -501,7 +501,7 @@ static void sierra_instat_callback(struc
 					sizeof(struct usb_ctrlrequest));
 			struct tty_struct *tty;
 
-			dev_dbg(&port->dev, "%s: signal x%x", __func__,
+			dev_dbg(&port->dev, "%s: signal x%x\n", __func__,
 				signals);
 
 			old_dcd_state = portdata->dcd_state;
@@ -516,12 +516,12 @@ static void sierra_instat_callback(struc
 				tty_hangup(tty);
 			tty_kref_put(tty);
 		} else {
-			dev_dbg(&port->dev, "%s: type %x req %x",
+			dev_dbg(&port->dev, "%s: type %x req %x\n",
 				__func__, req_pkt->bRequestType,
 				req_pkt->bRequest);
 		}
 	} else
-		dev_dbg(&port->dev, "%s: error %d", __func__, status);
+		dev_dbg(&port->dev, "%s: error %d\n", __func__, status);
 
 	/* Resubmit urb so we continue receiving IRQ data */
 	if (status != -ESHUTDOWN) {
@@ -529,7 +529,7 @@ static void sierra_instat_callback(struc
 		err = usb_submit_urb(urb, GFP_ATOMIC);
 		if (err)
 			dev_dbg(&port->dev, "%s: resubmit intr urb "
-				"failed. (%d)",	__func__, err);
+				"failed. (%d)\n",	__func__, err);
 	}
 }
 
@@ -539,7 +539,7 @@ static int sierra_write_room(struct tty_
 	struct sierra_port_private *portdata = usb_get_serial_port_data(port);
 	unsigned long flags;
 
-	dev_dbg(&port->dev, "%s - port %d", __func__, port->number);
+	dev_dbg(&port->dev, "%s - port %d\n", __func__, port->number);
 
 	/* try to give a good number back based on if we have any free urbs at
 	 * this point in time */
@@ -565,7 +565,7 @@ static int sierra_open(struct tty_struct
 
 	portdata = usb_get_serial_port_data(port);
 
-	dev_dbg(&port->dev, "%s", __func__);
+	dev_dbg(&port->dev, "%s\n", __func__);
 
 	/* Set some sane defaults */
 	portdata->rts_state = 1;
@@ -577,7 +577,7 @@ static int sierra_open(struct tty_struct
 		if (!urb)
 			continue;
 		if (urb->dev != serial->dev) {
-			dev_dbg(&port->dev, "%s: dev %p != %p",
+			dev_dbg(&port->dev, "%s: dev %p != %p\n",
 				 __func__, urb->dev, serial->dev);
 			continue;
 		}
@@ -630,7 +630,7 @@ static void sierra_close(struct usb_seri
 	struct usb_serial *serial = port->serial;
 	struct sierra_port_private *portdata;
 
-	dev_dbg(&port->dev, "%s", __func__);
+	dev_dbg(&port->dev, "%s\n", __func__);
 	portdata = usb_get_serial_port_data(port);
 
 	if (serial->dev) {
@@ -649,7 +649,7 @@ static int sierra_startup(struct usb_ser
 	int i;
 	int j;
 
-	dev_dbg(&serial->dev->dev, "%s", __func__);
+	dev_dbg(&serial->dev->dev, "%s\n", __func__);
 
 	/* Set Device mode to D0 */
 	sierra_set_power_state(serial->dev, 0x0000);
@@ -664,7 +664,7 @@ static int sierra_startup(struct usb_ser
 		portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
 		if (!portdata) {
 			dev_dbg(&port->dev, "%s: kmalloc for "
-				"sierra_port_private (%d) failed!.",
+				"sierra_port_private (%d) failed!\n",
 				__func__, i);
 			return -ENOMEM;
 		}
@@ -686,7 +686,7 @@ static int sierra_startup(struct usb_ser
 			urb = usb_alloc_urb(0, GFP_KERNEL);
 			if (urb == NULL) {
 				dev_dbg(&port->dev, "%s: alloc for in "
-					"port failed.", __func__);
+					"port failed.\n", __func__);
 				continue;
 			}
 			/* Fill URB using supplied data. */
@@ -708,7 +708,7 @@ static void sierra_shutdown(struct usb_s
 	struct usb_serial_port *port;
 	struct sierra_port_private *portdata;
 
-	dev_dbg(&serial->dev->dev, "%s", __func__);
+	dev_dbg(&serial->dev->dev, "%s\n", __func__);
 
 	for (i = 0; i < serial->num_ports; ++i) {
 		port = serial->port[i];



--
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