USB: serial: metro-usb: move to use dev_dbg() instead of dbg()

This properly ties the driver into the dynamic debug system and provides
the needed device identification when the messages are printed out.

It also removes a ton of checkpatch warnings as well, which is always a
nice validation that it's the correct thing to do.

Cc: Aleksey Babahin <tamerlan311@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c
index 6b7d277..6e1622f 100644
--- a/drivers/usb/serial/metro-usb.c
+++ b/drivers/usb/serial/metro-usb.c
@@ -66,7 +66,7 @@
 	int result = 0;
 	unsigned long flags = 0;
 
-	dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+	dev_dbg(&port->dev, "%s\n", __func__);
 
 	switch (urb->status) {
 	case 0:
@@ -76,12 +76,14 @@
 	case -ENOENT:
 	case -ESHUTDOWN:
 		/* urb has been terminated. */
-		dbg("METRO-USB - %s - urb shutting down, port number=%d, error code=%d",
-			__FUNCTION__, port->number, result);
+		dev_dbg(&port->dev,
+			"%s - urb shutting down, error code=%d\n",
+			__func__, result);
 		return;
 	default:
-		dbg("METRO-USB - %s - non-zero urb received, port number=%d, error code=%d",
-			__FUNCTION__, port->number, result);
+		dev_dbg(&port->dev,
+			"%s - non-zero urb received, error code=%d\n",
+			__func__, result);
 		goto exit;
 	}
 
@@ -89,7 +91,8 @@
 	/* Set the data read from the usb port into the serial port buffer. */
 	tty = tty_port_tty_get(&port->port);
 	if (!tty) {
-		dbg("%s - bad tty pointer - exiting", __func__);
+		dev_dbg(&port->dev, "%s - bad tty pointer - exiting\n",
+			__func__);
 		return;
 	}
 
@@ -117,25 +120,25 @@
 
 		result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
 
-		if (result) {
-			dbg("METRO-USB - %s - failed submitting interrupt in urb for port number=%d, error code=%d",
-				__FUNCTION__, port->number, result);
-		}
+		if (result)
+			dev_dbg(&port->dev,
+				"%s - failed submitting interrupt in urb, error code=%d\n",
+				__func__, result);
 	}
 	return;
 
 exit:
 	/* Try to resubmit the urb. */
 	result = usb_submit_urb(urb, GFP_ATOMIC);
-	if (result) {
-		dbg("METRO-USB - %s - failed submitting interrupt in urb for port number=%d, error code=%d",
-			__FUNCTION__, port->number, result);
-	}
+	if (result)
+		dev_dbg(&port->dev,
+			"%s - failed submitting interrupt in urb, error code=%d\n",
+			__func__, result);
 }
 
 static void metrousb_cleanup(struct usb_serial_port *port)
 {
-	dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+	dev_dbg(&port->dev, "%s\n", __func__);
 
 	if (port->serial->dev) {
 		/* Shutdown any interrupt in urbs. */
@@ -153,11 +156,12 @@
 	unsigned long flags = 0;
 	int result = 0;
 
-	dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+	dev_dbg(&port->dev, "%s\n", __func__);
 
 	/* Make sure the urb is initialized. */
 	if (!port->interrupt_in_urb) {
-		dbg("METRO-USB - %s - interrupt urb not initialized for port number=%d", __FUNCTION__, port->number);
+		dev_dbg(&port->dev, "%s - interrupt urb not initialized\n",
+			__func__);
 		return -ENODEV;
 	}
 
@@ -187,12 +191,13 @@
 	result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
 
 	if (result) {
-		dbg("METRO-USB - %s - failed submitting interrupt in urb for port number=%d, error code=%d"
-			, __FUNCTION__, port->number, result);
+		dev_dbg(&port->dev,
+			"%s - failed submitting interrupt in urb, error code=%d\n",
+			__func__, result);
 		goto exit;
 	}
 
-	dbg("METRO-USB - %s - port open for port number=%d", __FUNCTION__, port->number);
+	dev_dbg(&port->dev, "%s - port open\n", __func__);
 exit:
 	return result;
 }
@@ -202,7 +207,8 @@
 	int retval = 0;
 	unsigned char mcr = METROUSB_MCR_NONE;
 
-	dbg("METRO-USB - %s - control state=%d", __FUNCTION__, control_state);
+	dev_dbg(&serial->dev->dev, "%s - control state = %d\n",
+		__func__, control_state);
 
 	/* Set the modem control value. */
 	if (control_state & TIOCM_DTR)
@@ -215,7 +221,9 @@
 				METROUSB_SET_REQUEST_TYPE, METROUSB_SET_MODEM_CTRL_REQUEST,
 				control_state, 0, NULL, 0, WDR_TIMEOUT);
 	if (retval < 0)
-		dbg("METRO-USB - %s - set modem ctrl=0x%x failed, error code=%d", __FUNCTION__, mcr, retval);
+		dev_dbg(&serial->dev->dev,
+			"%s - set modem ctrl=0x%x failed, error code=%d\n",
+			__func__, mcr, retval);
 
 	return retval;
 }
@@ -224,7 +232,7 @@
 {
 	int i = 0;
 
-	dbg("METRO-USB - %s", __FUNCTION__);
+	dev_dbg(&serial->dev->dev, "%s\n", __func__);
 
 	/* Stop reading and writing on all ports. */
 	for (i = 0; i < serial->num_ports; ++i) {
@@ -235,7 +243,8 @@
 		kfree(usb_get_serial_port_data(serial->port[i]));
 		usb_set_serial_port_data(serial->port[i], NULL);
 
-		dbg("METRO-USB - %s - freed port number=%d", __FUNCTION__, serial->port[i]->number);
+		dev_dbg(&serial->dev->dev, "%s - freed port number=%d\n",
+			__func__, serial->port[i]->number);
 	}
 }
 
@@ -245,7 +254,7 @@
 	struct usb_serial_port *port;
 	int i = 0;
 
-	dbg("METRO-USB - %s", __FUNCTION__);
+	dev_dbg(&serial->dev->dev, "%s\n", __func__);
 
 	/* Loop through the serial ports setting up the private structures.
 	 * Currently we only use one port. */
@@ -261,7 +270,8 @@
 		spin_lock_init(&metro_priv->lock);
 		usb_set_serial_port_data(port, metro_priv);
 
-		dbg("METRO-USB - %s - port number=%d.", __FUNCTION__, port->number);
+		dev_dbg(&serial->dev->dev, "%s - port number=%d\n ",
+			__func__, port->number);
 	}
 
 	return 0;
@@ -273,7 +283,7 @@
 	struct metrousb_private *metro_priv = usb_get_serial_port_data(port);
 	unsigned long flags = 0;
 
-	dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+	dev_dbg(tty->dev, "%s\n", __func__);
 
 	/* Set the private information for the port to stop reading data. */
 	spin_lock_irqsave(&metro_priv->lock, flags);
@@ -288,7 +298,7 @@
 	struct metrousb_private *metro_priv = usb_get_serial_port_data(port);
 	unsigned long flags = 0;
 
-	dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+	dev_dbg(tty->dev, "%s\n", __func__);
 
 	spin_lock_irqsave(&metro_priv->lock, flags);
 	control_state = metro_priv->control_state;
@@ -306,7 +316,7 @@
 	unsigned long flags = 0;
 	unsigned long control_state = 0;
 
-	dbg("METRO-USB - %s - port number=%d, set=%d, clear=%d", __FUNCTION__, port->number, set, clear);
+	dev_dbg(tty->dev, "%s - set=%d, clear=%d\n", __func__, set, clear);
 
 	spin_lock_irqsave(&metro_priv->lock, flags);
 	control_state = metro_priv->control_state;
@@ -333,7 +343,7 @@
 	unsigned long flags = 0;
 	int result = 0;
 
-	dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+	dev_dbg(tty->dev, "%s\n", __func__);
 
 	/* Set the private information for the port to resume reading data. */
 	spin_lock_irqsave(&metro_priv->lock, flags);
@@ -343,10 +353,10 @@
 	/* Submit the urb to read from the port. */
 	port->interrupt_in_urb->dev = port->serial->dev;
 	result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
-	if (result) {
-		dbg("METRO-USB - %s - failed submitting interrupt in urb for port number=%d, error code=%d",
-			__FUNCTION__, port->number, result);
-	}
+	if (result)
+		dev_dbg(tty->dev,
+			"failed submitting interrupt in urb error code=%d\n",
+			result);
 }
 
 static struct usb_driver metrousb_driver = {