Skip to content

Commit 194343d

Browse files
committed
USB: remove use of err() in drivers/usb/serial
err() is going away, so switch to dev_err() or printk() if it's really needed. Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b887265 commit 194343d

21 files changed

+346
-243
lines changed

drivers/usb/serial/aircable.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ static void aircable_send(struct usb_serial_port *port)
220220

221221
buf = kzalloc(count + HCI_HEADER_LENGTH, GFP_ATOMIC);
222222
if (!buf) {
223-
err("%s- kzalloc(%d) failed.", __func__,
224-
count + HCI_HEADER_LENGTH);
223+
dev_err(&port->dev, "%s- kzalloc(%d) failed.\n",
224+
__func__, count + HCI_HEADER_LENGTH);
225225
return;
226226
}
227227

@@ -276,7 +276,7 @@ static void aircable_read(struct work_struct *work)
276276

277277
if (!tty) {
278278
schedule_work(&priv->rx_work);
279-
err("%s - No tty available", __func__);
279+
dev_err(&port->dev, "%s - No tty available\n", __func__);
280280
return ;
281281
}
282282

@@ -336,7 +336,7 @@ static int aircable_attach(struct usb_serial *serial)
336336

337337
priv = kzalloc(sizeof(struct aircable_private), GFP_KERNEL);
338338
if (!priv) {
339-
err("%s- kmalloc(%Zd) failed.", __func__,
339+
dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__,
340340
sizeof(struct aircable_private));
341341
return -ENOMEM;
342342
}

drivers/usb/serial/belkin_sa.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ static int belkin_sa_open(struct tty_struct *tty,
228228
port->read_urb->dev = port->serial->dev;
229229
retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
230230
if (retval) {
231-
err("usb_submit_urb(read bulk) failed");
231+
dev_err(&port->dev, "usb_submit_urb(read bulk) failed\n");
232232
goto exit;
233233
}
234234

235235
port->interrupt_in_urb->dev = port->serial->dev;
236236
retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
237237
if (retval) {
238238
usb_kill_urb(port->read_urb);
239-
err(" usb_submit_urb(read int) failed");
239+
dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
240240
}
241241

242242
exit:
@@ -342,8 +342,8 @@ static void belkin_sa_read_int_callback(struct urb *urb)
342342
exit:
343343
retval = usb_submit_urb(urb, GFP_ATOMIC);
344344
if (retval)
345-
err("%s - usb_submit_urb failed with result %d",
346-
__func__, retval);
345+
dev_err(&port->dev, "%s - usb_submit_urb failed with "
346+
"result %d\n", __func__, retval);
347347
}
348348

349349
static void belkin_sa_set_termios(struct tty_struct *tty,
@@ -382,12 +382,12 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
382382
if ((old_cflag & CBAUD) == B0) {
383383
control_state |= (TIOCM_DTR|TIOCM_RTS);
384384
if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 1) < 0)
385-
err("Set DTR error");
385+
dev_err(&port->dev, "Set DTR error\n");
386386
/* don't set RTS if using hardware flow control */
387387
if (!(old_cflag & CRTSCTS))
388388
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST
389389
, 1) < 0)
390-
err("Set RTS error");
390+
dev_err(&port->dev, "Set RTS error\n");
391391
}
392392
}
393393

@@ -403,18 +403,18 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
403403
/* Report the actual baud rate back to the caller */
404404
tty_encode_baud_rate(tty, baud, baud);
405405
if (BSA_USB_CMD(BELKIN_SA_SET_BAUDRATE_REQUEST, urb_value) < 0)
406-
err("Set baudrate error");
406+
dev_err(&port->dev, "Set baudrate error\n");
407407
} else {
408408
/* Disable flow control */
409409
if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST,
410410
BELKIN_SA_FLOW_NONE) < 0)
411-
err("Disable flowcontrol error");
411+
dev_err(&port->dev, "Disable flowcontrol error\n");
412412
/* Drop RTS and DTR */
413413
control_state &= ~(TIOCM_DTR | TIOCM_RTS);
414414
if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 0) < 0)
415-
err("DTR LOW error");
415+
dev_err(&port->dev, "DTR LOW error\n");
416416
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, 0) < 0)
417-
err("RTS LOW error");
417+
dev_err(&port->dev, "RTS LOW error\n");
418418
}
419419

420420
/* set the parity */
@@ -425,7 +425,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
425425
else
426426
urb_value = BELKIN_SA_PARITY_NONE;
427427
if (BSA_USB_CMD(BELKIN_SA_SET_PARITY_REQUEST, urb_value) < 0)
428-
err("Set parity error");
428+
dev_err(&port->dev, "Set parity error\n");
429429
}
430430

431431
/* set the number of data bits */
@@ -448,7 +448,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
448448
break;
449449
}
450450
if (BSA_USB_CMD(BELKIN_SA_SET_DATA_BITS_REQUEST, urb_value) < 0)
451-
err("Set data bits error");
451+
dev_err(&port->dev, "Set data bits error\n");
452452
}
453453

454454
/* set the number of stop bits */
@@ -457,7 +457,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
457457
: BELKIN_SA_STOP_BITS(1);
458458
if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST,
459459
urb_value) < 0)
460-
err("Set stop bits error");
460+
dev_err(&port->dev, "Set stop bits error\n");
461461
}
462462

463463
/* Set flow control */
@@ -478,7 +478,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
478478
urb_value &= ~(BELKIN_SA_FLOW_IRTS);
479479

480480
if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, urb_value) < 0)
481-
err("Set flow control error");
481+
dev_err(&port->dev, "Set flow control error\n");
482482
}
483483

484484
/* save off the modified port settings */
@@ -494,7 +494,7 @@ static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state)
494494
struct usb_serial *serial = port->serial;
495495

496496
if (BSA_USB_CMD(BELKIN_SA_SET_BREAK_REQUEST, break_state ? 1 : 0) < 0)
497-
err("Set break_ctl %d", break_state);
497+
dev_err(&port->dev, "Set break_ctl %d\n", break_state);
498498
}
499499

500500

@@ -554,13 +554,13 @@ static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file,
554554

555555
retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts);
556556
if (retval < 0) {
557-
err("Set RTS error %d", retval);
557+
dev_err(&port->dev, "Set RTS error %d\n", retval);
558558
goto exit;
559559
}
560560

561561
retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr);
562562
if (retval < 0) {
563-
err("Set DTR error %d", retval);
563+
dev_err(&port->dev, "Set DTR error %d\n", retval);
564564
goto exit;
565565
}
566566
exit:

drivers/usb/serial/cyberjack.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ static int cyberjack_startup(struct usb_serial *serial)
141141
result = usb_submit_urb(serial->port[i]->interrupt_in_urb,
142142
GFP_KERNEL);
143143
if (result)
144-
err(" usb_submit_urb(read int) failed");
144+
dev_err(&serial->dev->dev,
145+
"usb_submit_urb(read int) failed\n");
145146
dbg("%s - usb_submit_urb(int urb)", __func__);
146147
}
147148

@@ -274,8 +275,9 @@ static int cyberjack_write(struct tty_struct *tty,
274275
/* send the data out the bulk port */
275276
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
276277
if (result) {
277-
err("%s - failed submitting write urb, error %d",
278-
__func__, result);
278+
dev_err(&port->dev,
279+
"%s - failed submitting write urb, error %d",
280+
__func__, result);
279281
/* Throw away data. No better idea what to do with it. */
280282
priv->wrfilled = 0;
281283
priv->wrsent = 0;
@@ -351,7 +353,9 @@ static void cyberjack_read_int_callback(struct urb *urb)
351353
port->read_urb->dev = port->serial->dev;
352354
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
353355
if (result)
354-
err("%s - failed resubmitting read urb, error %d", __func__, result);
356+
dev_err(&port->dev, "%s - failed resubmitting "
357+
"read urb, error %d\n",
358+
__func__, result);
355359
dbg("%s - usb_submit_urb(read urb)", __func__);
356360
}
357361
}
@@ -360,7 +364,7 @@ static void cyberjack_read_int_callback(struct urb *urb)
360364
port->interrupt_in_urb->dev = port->serial->dev;
361365
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
362366
if (result)
363-
err(" usb_submit_urb(read int) failed");
367+
dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
364368
dbg("%s - usb_submit_urb(int urb)", __func__);
365369
}
366370

@@ -414,8 +418,8 @@ static void cyberjack_read_bulk_callback(struct urb *urb)
414418
port->read_urb->dev = port->serial->dev;
415419
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
416420
if (result)
417-
err("%s - failed resubmitting read urb, error %d",
418-
__func__, result);
421+
dev_err(&port->dev, "%s - failed resubmitting read "
422+
"urb, error %d\n", __func__, result);
419423
dbg("%s - usb_submit_urb(read urb)", __func__);
420424
}
421425
}
@@ -462,8 +466,9 @@ static void cyberjack_write_bulk_callback(struct urb *urb)
462466
/* send the data out the bulk port */
463467
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
464468
if (result) {
465-
err("%s - failed submitting write urb, error %d",
466-
__func__, result);
469+
dev_err(&port->dev,
470+
"%s - failed submitting write urb, error %d\n",
471+
__func__, result);
467472
/* Throw away data. No better idea what to do with it. */
468473
priv->wrfilled = 0;
469474
priv->wrsent = 0;

drivers/usb/serial/cypress_m8.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ static int cypress_serial_control(struct tty_struct *tty,
404404
retval != -ENODEV);
405405

406406
if (retval != sizeof(feature_buffer)) {
407-
err("%s - failed sending serial line settings - %d",
408-
__func__, retval);
407+
dev_err(&port->dev, "%s - failed sending serial "
408+
"line settings - %d\n", __func__, retval);
409409
cypress_set_dead(port);
410410
} else {
411411
spin_lock_irqsave(&priv->lock, flags);
@@ -443,7 +443,8 @@ static int cypress_serial_control(struct tty_struct *tty,
443443
&& retval != -ENODEV);
444444

445445
if (retval != sizeof(feature_buffer)) {
446-
err("%s - failed to retrieve serial line settings - %d", __func__, retval);
446+
dev_err(&port->dev, "%s - failed to retrieve serial "
447+
"line settings - %d\n", __func__, retval);
447448
cypress_set_dead(port);
448449
return retval;
449450
} else {
@@ -476,8 +477,8 @@ static void cypress_set_dead(struct usb_serial_port *port)
476477
priv->comm_is_ok = 0;
477478
spin_unlock_irqrestore(&priv->lock, flags);
478479

479-
err("cypress_m8 suspending failing port %d - interval might be too short",
480-
port->number);
480+
dev_err(&port->dev, "cypress_m8 suspending failing port %d - "
481+
"interval might be too short\n", port->number);
481482
}
482483

483484

@@ -679,7 +680,8 @@ static int cypress_open(struct tty_struct *tty,
679680

680681
/* setup the port and start reading from the device */
681682
if (!port->interrupt_in_urb) {
682-
err("%s - interrupt_in_urb is empty!", __func__);
683+
dev_err(&port->dev, "%s - interrupt_in_urb is empty!\n",
684+
__func__);
683685
return -1;
684686
}
685687

@@ -1107,8 +1109,8 @@ static void cypress_set_termios(struct tty_struct *tty,
11071109
data_bits = 3;
11081110
break;
11091111
default:
1110-
err("%s - CSIZE was set, but not CS5-CS8",
1111-
__func__);
1112+
dev_err(&port->dev, "%s - CSIZE was set, but not CS5-CS8\n",
1113+
__func__);
11121114
data_bits = 3;
11131115
}
11141116
spin_lock_irqsave(&priv->lock, flags);

0 commit comments

Comments
 (0)