diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-14 19:30:23 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-14 19:30:23 -0400 |
| commit | 049c6b4e8f85d9ef5f26c8a974e5e9fb084f8ce0 (patch) | |
| tree | eb8ed1608f26242f8af733a267b68c3de2e1ab87 | |
| parent | 9c134a14f2da1631d583090a898a8b9d40930472 (diff) | |
USB: serial: keyspan: remove dbg() usage
dbg() was a very old USB-serial-specific macro.
This patch removes it from being used in the keyspan
driver and uses dev_dbg() instead.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/usb/serial/keyspan.c | 290 | ||||
| -rw-r--r-- | drivers/usb/serial/keyspan.h | 17 |
2 files changed, 159 insertions, 148 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index f0d4f3fcf4f7..0d37581fabb1 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
| @@ -165,7 +165,7 @@ static void keyspan_set_termios(struct tty_struct *tty, | |||
| 165 | so other rates can be generated if desired. */ | 165 | so other rates can be generated if desired. */ |
| 166 | baud_rate = tty_get_baud_rate(tty); | 166 | baud_rate = tty_get_baud_rate(tty); |
| 167 | /* If no match or invalid, don't change */ | 167 | /* If no match or invalid, don't change */ |
| 168 | if (d_details->calculate_baud_rate(baud_rate, d_details->baudclk, | 168 | if (d_details->calculate_baud_rate(port, baud_rate, d_details->baudclk, |
| 169 | NULL, NULL, NULL, device_port) == KEYSPAN_BAUD_RATE_OK) { | 169 | NULL, NULL, NULL, device_port) == KEYSPAN_BAUD_RATE_OK) { |
| 170 | /* FIXME - more to do here to ensure rate changes cleanly */ | 170 | /* FIXME - more to do here to ensure rate changes cleanly */ |
| 171 | /* FIXME - calcuate exact rate from divisor ? */ | 171 | /* FIXME - calcuate exact rate from divisor ? */ |
| @@ -241,8 +241,8 @@ static int keyspan_write(struct tty_struct *tty, | |||
| 241 | dataOffset = 1; | 241 | dataOffset = 1; |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | dbg("%s - for port %d (%d chars), flip=%d", | 244 | dev_dbg(&port->dev, "%s - for port %d (%d chars), flip=%d\n", |
| 245 | __func__, port->number, count, p_priv->out_flip); | 245 | __func__, port->number, count, p_priv->out_flip); |
| 246 | 246 | ||
| 247 | for (left = count; left > 0; left -= todo) { | 247 | for (left = count; left > 0; left -= todo) { |
| 248 | todo = left; | 248 | todo = left; |
| @@ -255,11 +255,11 @@ static int keyspan_write(struct tty_struct *tty, | |||
| 255 | this_urb = p_priv->out_urbs[flip]; | 255 | this_urb = p_priv->out_urbs[flip]; |
| 256 | if (this_urb == NULL) { | 256 | if (this_urb == NULL) { |
| 257 | /* no bulk out, so return 0 bytes written */ | 257 | /* no bulk out, so return 0 bytes written */ |
| 258 | dbg("%s - no output urb :(", __func__); | 258 | dev_dbg(&port->dev, "%s - no output urb :(\n", __func__); |
| 259 | return count; | 259 | return count; |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | dbg("%s - endpoint %d flip %d", | 262 | dev_dbg(&port->dev, "%s - endpoint %d flip %d\n", |
| 263 | __func__, usb_pipeendpoint(this_urb->pipe), flip); | 263 | __func__, usb_pipeendpoint(this_urb->pipe), flip); |
| 264 | 264 | ||
| 265 | if (this_urb->status == -EINPROGRESS) { | 265 | if (this_urb->status == -EINPROGRESS) { |
| @@ -282,7 +282,7 @@ static int keyspan_write(struct tty_struct *tty, | |||
| 282 | 282 | ||
| 283 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 283 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
| 284 | if (err != 0) | 284 | if (err != 0) |
| 285 | dbg("usb_submit_urb(write bulk) failed (%d)", err); | 285 | dev_dbg(&port->dev, "usb_submit_urb(write bulk) failed (%d)\n", err); |
| 286 | p_priv->tx_start_time[flip] = jiffies; | 286 | p_priv->tx_start_time[flip] = jiffies; |
| 287 | 287 | ||
| 288 | /* Flip for next time if usa26 or usa28 interface | 288 | /* Flip for next time if usa26 or usa28 interface |
| @@ -305,8 +305,8 @@ static void usa26_indat_callback(struct urb *urb) | |||
| 305 | endpoint = usb_pipeendpoint(urb->pipe); | 305 | endpoint = usb_pipeendpoint(urb->pipe); |
| 306 | 306 | ||
| 307 | if (status) { | 307 | if (status) { |
| 308 | dbg("%s - nonzero status: %x on endpoint %d.", | 308 | dev_dbg(&urb->dev->dev,"%s - nonzero status: %x on endpoint %d.\n", |
| 309 | __func__, status, endpoint); | 309 | __func__, status, endpoint); |
| 310 | return; | 310 | return; |
| 311 | } | 311 | } |
| 312 | 312 | ||
| @@ -325,7 +325,7 @@ static void usa26_indat_callback(struct urb *urb) | |||
| 325 | tty_insert_flip_char(tty, data[i], err); | 325 | tty_insert_flip_char(tty, data[i], err); |
| 326 | } else { | 326 | } else { |
| 327 | /* some bytes had errors, every byte has status */ | 327 | /* some bytes had errors, every byte has status */ |
| 328 | dbg("%s - RX error!!!!", __func__); | 328 | dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); |
| 329 | for (i = 0; i + 1 < urb->actual_length; i += 2) { | 329 | for (i = 0; i + 1 < urb->actual_length; i += 2) { |
| 330 | int stat = data[i], flag = 0; | 330 | int stat = data[i], flag = 0; |
| 331 | if (stat & RXERROR_OVERRUN) | 331 | if (stat & RXERROR_OVERRUN) |
| @@ -345,7 +345,7 @@ static void usa26_indat_callback(struct urb *urb) | |||
| 345 | /* Resubmit urb so we continue receiving */ | 345 | /* Resubmit urb so we continue receiving */ |
| 346 | err = usb_submit_urb(urb, GFP_ATOMIC); | 346 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 347 | if (err != 0) | 347 | if (err != 0) |
| 348 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 348 | dev_dbg(&port->dev, "%s - resubmit read urb failed. (%d)\n", __func__, err); |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | /* Outdat handling is common for all devices */ | 351 | /* Outdat handling is common for all devices */ |
| @@ -356,7 +356,7 @@ static void usa2x_outdat_callback(struct urb *urb) | |||
| 356 | 356 | ||
| 357 | port = urb->context; | 357 | port = urb->context; |
| 358 | p_priv = usb_get_serial_port_data(port); | 358 | p_priv = usb_get_serial_port_data(port); |
| 359 | dbg("%s - urb %d", __func__, urb == p_priv->out_urbs[1]); | 359 | dev_dbg(&port->dev, "%s - urb %d\n", __func__, urb == p_priv->out_urbs[1]); |
| 360 | 360 | ||
| 361 | usb_serial_port_softint(port); | 361 | usb_serial_port_softint(port); |
| 362 | } | 362 | } |
| @@ -374,7 +374,7 @@ static void usa26_outcont_callback(struct urb *urb) | |||
| 374 | p_priv = usb_get_serial_port_data(port); | 374 | p_priv = usb_get_serial_port_data(port); |
| 375 | 375 | ||
| 376 | if (p_priv->resend_cont) { | 376 | if (p_priv->resend_cont) { |
| 377 | dbg("%s - sending setup", __func__); | 377 | dev_dbg(&port->dev, "%s - sending setup\n", __func__); |
| 378 | keyspan_usa26_send_setup(port->serial, port, | 378 | keyspan_usa26_send_setup(port->serial, port, |
| 379 | p_priv->resend_cont - 1); | 379 | p_priv->resend_cont - 1); |
| 380 | } | 380 | } |
| @@ -394,20 +394,22 @@ static void usa26_instat_callback(struct urb *urb) | |||
| 394 | serial = urb->context; | 394 | serial = urb->context; |
| 395 | 395 | ||
| 396 | if (status) { | 396 | if (status) { |
| 397 | dbg("%s - nonzero status: %x", __func__, status); | 397 | dev_dbg(&urb->dev->dev, "%s - nonzero status: %x\n", __func__, status); |
| 398 | return; | 398 | return; |
| 399 | } | 399 | } |
| 400 | if (urb->actual_length != 9) { | 400 | if (urb->actual_length != 9) { |
| 401 | dbg("%s - %d byte report??", __func__, urb->actual_length); | 401 | dev_dbg(&urb->dev->dev, "%s - %d byte report??\n", __func__, urb->actual_length); |
| 402 | goto exit; | 402 | goto exit; |
| 403 | } | 403 | } |
| 404 | 404 | ||
| 405 | msg = (struct keyspan_usa26_portStatusMessage *)data; | 405 | msg = (struct keyspan_usa26_portStatusMessage *)data; |
| 406 | 406 | ||
| 407 | #if 0 | 407 | #if 0 |
| 408 | dbg("%s - port status: port %d cts %d dcd %d dsr %d ri %d toff %d txoff %d rxen %d cr %d", | 408 | dev_dbg(&urb->dev->dev, |
| 409 | __func__, msg->port, msg->hskia_cts, msg->gpia_dcd, msg->dsr, msg->ri, msg->_txOff, | 409 | "%s - port status: port %d cts %d dcd %d dsr %d ri %d toff %d txoff %d rxen %d cr %d", |
| 410 | msg->_txXoff, msg->rxEnabled, msg->controlResponse); | 410 | __func__, msg->port, msg->hskia_cts, msg->gpia_dcd, msg->dsr, |
| 411 | msg->ri, msg->_txOff, msg->_txXoff, msg->rxEnabled, | ||
| 412 | msg->controlResponse); | ||
| 411 | #endif | 413 | #endif |
| 412 | 414 | ||
| 413 | /* Now do something useful with the data */ | 415 | /* Now do something useful with the data */ |
| @@ -415,7 +417,7 @@ static void usa26_instat_callback(struct urb *urb) | |||
| 415 | 417 | ||
| 416 | /* Check port number from message and retrieve private data */ | 418 | /* Check port number from message and retrieve private data */ |
| 417 | if (msg->port >= serial->num_ports) { | 419 | if (msg->port >= serial->num_ports) { |
| 418 | dbg("%s - Unexpected port number %d", __func__, msg->port); | 420 | dev_dbg(&urb->dev->dev, "%s - Unexpected port number %d\n", __func__, msg->port); |
| 419 | goto exit; | 421 | goto exit; |
| 420 | } | 422 | } |
| 421 | port = serial->port[msg->port]; | 423 | port = serial->port[msg->port]; |
| @@ -438,7 +440,7 @@ static void usa26_instat_callback(struct urb *urb) | |||
| 438 | /* Resubmit urb so we continue receiving */ | 440 | /* Resubmit urb so we continue receiving */ |
| 439 | err = usb_submit_urb(urb, GFP_ATOMIC); | 441 | err = usb_submit_urb(urb, GFP_ATOMIC); |
| 440 | if (err != 0) | 442 | if (err != 0) |
| 441 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 443 | dev_dbg(&port->dev, "%s - resubmit read urb failed. (%d)\n", __func__, err); |
| 442 | exit: ; | 444 | exit: ; |
| 443 | } | 445 | } |
| 444 | 446 | ||
| @@ -465,8 +467,8 @@ static void usa28_indat_callback(struct urb *urb) | |||
| 465 | 467 | ||
| 466 | do { | 468 | do { |
| 467 | if (status) { | 469 | if (status) { |
| 468 | dbg("%s - nonzero status: %x on endpoint %d.", | 470 | dev_dbg(&urb->dev->dev, "%s - nonzero status: %x on endpoint %d.\n", |
| 469 | __func__, status, usb_pipeendpoint(urb->pipe)); | 471 | __func__, status, usb_pipeendpoint(urb->pipe)); |
| 470 | return; | 472 | return; |
| 471 | } | 473 | } |
| 472 | 474 | ||
| @@ -484,7 +486,7 @@ static void usa28_inda | |||
