aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Grandegger <wg@grandegger.com>2012-02-01 05:02:05 -0500
committerMarc Kleine-Budde <mkl@pengutronix.de>2012-02-02 19:21:26 -0500
commitaabdfd6adb804d0aaba0188ade0f1afe42a52e31 (patch)
treeb329ab5b070c5340f60bc1d125e1655d340ee457
parent79d0d8a7d5edca459f544c2ad75088e99307795e (diff)
can: replace the dev_dbg/info/err/... with the new netdev_xxx macros
Cc: uclinux-dist-devel@blackfin.uclinux.org Cc: Anant Gole <anantgole@ti.com> Cc: Chris Elston <celston@katalix.com> Cc: Sebastian Haas <haas@ems-wuensche.com> Cc: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Acked-by: Sebastian Haas <dev@sebastianhaas.info> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--drivers/net/can/bfin_can.c21
-rw-r--r--drivers/net/can/dev.c23
-rw-r--r--drivers/net/can/flexcan.c44
-rw-r--r--drivers/net/can/mcp251x.c3
-rw-r--r--drivers/net/can/mscan/mscan.c17
-rw-r--r--drivers/net/can/sja1000/sja1000.c19
-rw-r--r--drivers/net/can/ti_hecc.c20
-rw-r--r--drivers/net/can/usb/ems_usb.c57
-rw-r--r--drivers/net/can/usb/esd_usb2.c27
9 files changed, 103 insertions, 128 deletions
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index e1e7f9da3da5..3f88473423e9 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -82,8 +82,7 @@ static int bfin_can_set_bittiming(struct net_device *dev)
82 bfin_write(&reg->clock, clk); 82 bfin_write(&reg->clock, clk);
83 bfin_write(&reg->timing, timing); 83 bfin_write(&reg->timing, timing);
84 84
85 dev_info(dev->dev.parent, "setting CLOCK=0x%04x TIMING=0x%04x\n", 85 netdev_info(dev, "setting CLOCK=0x%04x TIMING=0x%04x\n", clk, timing);
86 clk, timing);
87 86
88 return 0; 87 return 0;
89} 88}
@@ -108,8 +107,7 @@ static void bfin_can_set_reset_mode(struct net_device *dev)
108 while (!(bfin_read(&reg->control) & CCA)) { 107 while (!(bfin_read(&reg->control) & CCA)) {
109 udelay(10); 108 udelay(10);
110 if (--timeout == 0) { 109 if (--timeout == 0) {
111 dev_err(dev->dev.parent, 110 netdev_err(dev, "fail to enter configuration mode\n");
112 "fail to enter configuration mode\n");
113 BUG(); 111 BUG();
114 } 112 }
115 } 113 }
@@ -165,8 +163,7 @@ static void bfin_can_set_normal_mode(struct net_device *dev)
165 while (bfin_read(&reg->status) & CCA) { 163 while (bfin_read(&reg->status) & CCA) {
166 udelay(10); 164 udelay(10);
167 if (--timeout == 0) { 165 if (--timeout == 0) {
168 dev_err(dev->dev.parent, 166 netdev_err(dev, "fail to leave configuration mode\n");
169 "fail to leave configuration mode\n");
170 BUG(); 167 BUG();
171 } 168 }
172 } 169 }
@@ -345,7 +342,7 @@ static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status)
345 342
346 if (isrc & RMLIS) { 343 if (isrc & RMLIS) {
347 /* data overrun interrupt */ 344 /* data overrun interrupt */
348 dev_dbg(dev->dev.parent, "data overrun interrupt\n"); 345 netdev_dbg(dev, "data overrun interrupt\n");
349 cf->can_id |= CAN_ERR_CRTL; 346 cf->can_id |= CAN_ERR_CRTL;
350 cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW; 347 cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
351 stats->rx_over_errors++; 348 stats->rx_over_errors++;
@@ -353,7 +350,7 @@ static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status)
353 } 350 }
354 351
355 if (isrc & BOIS) { 352 if (isrc & BOIS) {
356 dev_dbg(dev->dev.parent, "bus-off mode interrupt\n"); 353 netdev_dbg(dev, "bus-off mode interrupt\n");
357 state = CAN_STATE_BUS_OFF; 354 state = CAN_STATE_BUS_OFF;
358 cf->can_id |= CAN_ERR_BUSOFF; 355 cf->can_id |= CAN_ERR_BUSOFF;
359 can_bus_off(dev); 356 can_bus_off(dev);
@@ -361,13 +358,12 @@ static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status)
361 358
362 if (isrc & EPIS) { 359 if (isrc & EPIS) {
363 /* error passive interrupt */ 360 /* error passive interrupt */
364 dev_dbg(dev->dev.parent, "error passive interrupt\n"); 361 netdev_dbg(dev, "error passive interrupt\n");
365 state = CAN_STATE_ERROR_PASSIVE; 362 state = CAN_STATE_ERROR_PASSIVE;
366 } 363 }
367 364
368 if ((isrc & EWTIS) || (isrc & EWRIS)) { 365 if ((isrc & EWTIS) || (isrc & EWRIS)) {
369 dev_dbg(dev->dev.parent, 366 netdev_dbg(dev, "Error Warning Transmit/Receive Interrupt\n");
370 "Error Warning Transmit/Receive Interrupt\n");
371 state = CAN_STATE_ERROR_WARNING; 367 state = CAN_STATE_ERROR_WARNING;
372 } 368 }
373 369
@@ -651,8 +647,7 @@ static int bfin_can_suspend(struct platform_device *pdev, pm_message_t mesg)
651 while (!(bfin_read(&reg->intr) & SMACK)) { 647 while (!(bfin_read(&reg->intr) & SMACK)) {
652 udelay(10); 648 udelay(10);
653 if (--timeout == 0) { 649 if (--timeout == 0) {
654 dev_err(dev->dev.parent, 650 netdev_err(dev, "fail to enter sleep mode\n");
655 "fail to enter sleep mode\n");
656 BUG(); 651 BUG();
657 } 652 }
658 } 653 }
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 9d9799cf68cd..c5fe3a3db8c9 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -130,13 +130,13 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt)
130 /* Error in one-tenth of a percent */ 130 /* Error in one-tenth of a percent */
131 error = (best_error * 1000) / bt->bitrate; 131 error = (best_error * 1000) / bt->bitrate;
132 if (error > CAN_CALC_MAX_ERROR) { 132 if (error > CAN_CALC_MAX_ERROR) {
133 dev_err(dev->dev.parent, 133 netdev_err(dev,
134 "bitrate error %ld.%ld%% too high\n", 134 "bitrate error %ld.%ld%% too high\n",
135 error / 10, error % 10); 135 error / 10, error % 10);
136 return -EDOM; 136 return -EDOM;
137 } else { 137 } else {
138 dev_warn(dev->dev.parent, "bitrate error %ld.%ld%%\n", 138 netdev_warn(dev, "bitrate error %ld.%ld%%\n",
139 error / 10, error % 10); 139 error / 10, error % 10);
140 } 140 }
141 } 141 }
142 142
@@ -172,7 +172,7 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt)
172#else /* !CONFIG_CAN_CALC_BITTIMING */ 172#else /* !CONFIG_CAN_CALC_BITTIMING */
173static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt) 173static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt)
174{ 174{
175 dev_err(dev->dev.parent, "bit-timing calculation not available\n"); 175 netdev_err(dev, "bit-timing calculation not available\n");
176 return -EINVAL; 176 return -EINVAL;
177} 177}
178#endif /* CONFIG_CAN_CALC_BITTIMING */ 178#endif /* CONFIG_CAN_CALC_BITTIMING */
@@ -313,8 +313,7 @@ void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
313 priv->echo_skb[idx] = skb; 313 priv->echo_skb[idx] = skb;
314 } else { 314 } else {
315 /* locking problem with netif_stop_queue() ?? */ 315 /* locking problem with netif_stop_queue() ?? */
316 dev_err(dev->dev.parent, "%s: BUG! echo_skb is occupied!\n", 316 netdev_err(dev, "%s: BUG! echo_skb is occupied!\n", __func__);
317 __func__);
318 kfree_skb(skb); 317 kfree_skb(skb);
319 } 318 }
320} 319}
@@ -400,7 +399,7 @@ void can_restart(unsigned long data)
400 stats->rx_bytes += cf->can_dlc; 399 stats->rx_bytes += cf->can_dlc;
401 400
402restart: 401restart:
403 dev_dbg(dev->dev.parent, "restarted\n"); 402 netdev_dbg(dev, "restarted\n");
404 priv->can_stats.restarts++; 403 priv->can_stats.restarts++;
405 404
406 /* Now restart the device */ 405 /* Now restart the device */
@@ -408,7 +407,7 @@ restart:
408 407
409 netif_carrier_on(dev); 408 netif_carrier_on(dev);
410 if (err) 409 if (err)
411 dev_err(dev->dev.parent, "Error %d during restart", err); 410 netdev_err(dev, "Error %d during restart", err);
412} 411}
413 412
414int can_restart_now(struct net_device *dev) 413int can_restart_now(struct net_device *dev)
@@ -441,7 +440,7 @@ void can_bus_off(struct net_device *dev)
441{ 440{
442 struct can_priv *priv = netdev_priv(dev); 441 struct can_priv *priv = netdev_priv(dev);
443 442
444 dev_dbg(dev->dev.parent, "bus-off\n"); 443 netdev_dbg(dev, "bus-off\n");
445 444
446 netif_carrier_off(dev); 445 netif_carrier_off(dev);
447 priv->can_stats.bus_off++; 446 priv->can_stats.bus_off++;
@@ -553,7 +552,7 @@ int open_candev(struct net_device *dev)
553 struct can_priv *priv = netdev_priv(dev); 552 struct can_priv *priv = netdev_priv(dev);
554 553
555 if (!priv->bittiming.tq && !priv->bittiming.bitrate) { 554 if (!priv->bittiming.tq && !priv->bittiming.bitrate) {
556 dev_err(dev->dev.parent, "bit-timing not yet defined\n"); 555 netdev_err(dev, "bit-timing not yet defined\n");
557 return -EINVAL; 556 return -EINVAL;
558 } 557 }
559 558
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index ab0136f49f49..e636287213fa 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -315,34 +315,34 @@ static void do_bus_err(struct net_device *dev,
315 cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR; 315 cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
316 316
317 if (reg_esr & FLEXCAN_ESR_BIT1_ERR) { 317 if (reg_esr & FLEXCAN_ESR_BIT1_ERR) {
318 dev_dbg(dev->dev.parent, "BIT1_ERR irq\n"); 318 netdev_dbg(dev, "BIT1_ERR irq\n");
319 cf->data[2] |= CAN_ERR_PROT_BIT1; 319 cf->data[2] |= CAN_ERR_PROT_BIT1;
320 tx_errors = 1; 320 tx_errors = 1;
321 } 321 }
322 if (reg_esr & FLEXCAN_ESR_BIT0_ERR) { 322 if (reg_esr & FLEXCAN_ESR_BIT0_ERR) {
323 dev_dbg(dev->dev.parent, "BIT0_ERR irq\n"); 323 netdev_dbg(dev, "BIT0_ERR irq\n");
324 cf->data[2] |= CAN_ERR_PROT_BIT0; 324 cf->data[2] |= CAN_ERR_PROT_BIT0;
325 tx_errors = 1; 325 tx_errors = 1;
326 } 326 }
327 if (reg_esr & FLEXCAN_ESR_ACK_ERR) { 327 if (reg_esr & FLEXCAN_ESR_ACK_ERR) {
328 dev_dbg(dev->dev.parent, "ACK_ERR irq\n"); 328 netdev_dbg(dev, "ACK_ERR irq\n");
329 cf->can_id |= CAN_ERR_ACK; 329 cf->can_id |= CAN_ERR_ACK;
330 cf->data[3] |= CAN_ERR_PROT_LOC_ACK; 330 cf->data[3] |= CAN_ERR_PROT_LOC_ACK;
331 tx_errors = 1; 331 tx_errors = 1;
332 } 332 }
333 if (reg_esr & FLEXCAN_ESR_CRC_ERR) { 333 if (reg_esr & FLEXCAN_ESR_CRC_ERR) {
334 dev_dbg(dev->dev.parent, "CRC_ERR irq\n"); 334 netdev_dbg(dev, "CRC_ERR irq\n");
335 cf->data[2] |= CAN_ERR_PROT_BIT; 335 cf->data[2] |= CAN_ERR_PROT_BIT;
336 cf->data[3] |= CAN_ERR_PROT_LOC_CRC_SEQ; 336 cf->data[3] |= CAN_ERR_PROT_LOC_CRC_SEQ;
337 rx_errors = 1; 337 rx_errors = 1;
338 } 338 }
339 if (reg_esr & FLEXCAN_ESR_FRM_ERR) { 339 if (reg_esr & FLEXCAN_ESR_FRM_ERR) {
340 dev_dbg(dev->dev.parent, "FRM_ERR irq\n"); 340 netdev_dbg(dev, "FRM_ERR irq\n");
341 cf->data[2] |= CAN_ERR_PROT_FORM; 341 cf->data[2] |= CAN_ERR_PROT_FORM;
342 rx_errors = 1; 342 rx_errors = 1;
343 } 343 }
344 if (reg_esr & FLEXCAN_ESR_STF_ERR) { 344 if (reg_esr & FLEXCAN_ESR_STF_ERR) {
345 dev_dbg(dev->dev.parent, "STF_ERR irq\n"); 345 netdev_dbg(dev, "STF_ERR irq\n");
346 cf->data[2] |= CAN_ERR_PROT_STUFF; 346 cf->data[2] |= CAN_ERR_PROT_STUFF;
347 rx_errors = 1; 347 rx_errors = 1;
348 } 348 }
@@ -389,7 +389,7 @@ static void do_state(struct net_device *dev,
389 */ 389 */
390 if (new_state >= CAN_STATE_ERROR_WARNING && 390 if (new_state >= CAN_STATE_ERROR_WARNING &&
391 new_state <= CAN_STATE_BUS_OFF) { 391 new_state <= CAN_STATE_BUS_OFF) {
392 dev_dbg(dev->dev.parent, "Error Warning IRQ\n"); 392 netdev_dbg(dev, "Error Warning IRQ\n");
393 priv->can.can_stats.error_warning++; 393 priv->can.can_stats.error_warning++;
394 394
395 cf->can_id |= CAN_ERR_CRTL; 395 cf->can_id |= CAN_ERR_CRTL;
@@ -405,7 +405,7 @@ static void do_state(struct net_device *dev,
405 */ 405 */
406 if (new_state >= CAN_STATE_ERROR_PASSIVE && 406 if (new_state >= CAN_STATE_ERROR_PASSIVE &&
407 new_state <= CAN_STATE_BUS_OFF) { 407 new_state <= CAN_STATE_BUS_OFF) {
408 dev_dbg(dev->dev.parent, "Error Passive IRQ\n"); 408 netdev_dbg(dev, "Error Passive IRQ\n");
409 priv->can.can_stats.error_passive++; 409 priv->can.can_stats.error_passive++;
410 410
411 cf->can_id |= CAN_ERR_CRTL; 411 cf->can_id |= CAN_ERR_CRTL;
@@ -415,8 +415,8 @@ static void do_state(struct net_device *dev,
415 } 415 }
416 break; 416 break;
417 case CAN_STATE_BUS_OFF: 417 case CAN_STATE_BUS_OFF:
418 dev_err(dev->dev.parent, 418 netdev_err(dev, "BUG! "
419 "BUG! hardware recovered automatically from BUS_OFF\n"); 419 "hardware recovered automatically from BUS_OFF\n");
420 break; 420 break;
421 default: 421 default:
422 break; 422 break;
@@ -425,7 +425,7 @@ static void do_state(struct net_device *dev,
425 /* process state changes depending on the new state */ 425 /* process state changes depending on the new state */
426 switch (new_state) { 426 switch (new_state) {
427 case CAN_STATE_ERROR_ACTIVE: 427 case CAN_STATE_ERROR_ACTIVE:
428 dev_dbg(dev->dev.parent, "Error Active\n"); 428 netdev_dbg(dev, "Error Active\n");
429 cf->can_id |= CAN_ERR_PROT; 429 cf->can_id |= CAN_ERR_PROT;
430 cf->data[2] = CAN_ERR_PROT_ACTIVE; 430 cf->data[2] = CAN_ERR_PROT_ACTIVE;
431 break; 431 break;
@@ -644,12 +644,12 @@ static void flexcan_set_bittiming(struct net_device *dev)
644 if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) 644 if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
645 reg |= FLEXCAN_CTRL_SMP; 645 reg |= FLEXCAN_CTRL_SMP;
646 646
647 dev_info(dev->dev.parent, "writing ctrl=0x%08x\n", reg); 647 netdev_info(dev, "writing ctrl=0x%08x\n", reg);
648 flexcan_write(reg, &regs->ctrl); 648 flexcan_write(reg, &regs->ctrl);
649 649
650 /* print chip status */ 650 /* print chip status */
651 dev_dbg(dev->dev.parent, "%s: mcr=0x%08x ctrl=0x%08x\n", __func__, 651 netdev_dbg(dev, "%s: mcr=0x%08x ctrl=0x%08x\n", __func__,
652 flexcan_read(&regs->mcr), flexcan_read(&regs->ctrl)); 652 flexcan_read(&regs->mcr), flexcan_read(&regs->ctrl));
653} 653}
654 654
655/* 655/*
@@ -675,9 +675,8 @@ static int flexcan_chip_start(struct net_device *dev)
675 675
676 reg_mcr = flexcan_read(&regs->mcr); 676 reg_mcr = flexcan_read(&regs->mcr);
677 if (reg_mcr & FLEXCAN_MCR_SOFTRST) { 677 if (reg_mcr & FLEXCAN_MCR_SOFTRST) {
678 dev_err(dev->dev.parent, 678 netdev_err(dev, "Failed to softreset can module (mcr=0x%08x)\n",
679 "Failed to softreset can module (mcr=0x%08x)\n", 679 reg_mcr);
680 reg_mcr);
681 err = -ENODEV; 680 err = -ENODEV;
682 goto out; 681 goto out;
683 } 682 }
@@ -700,7 +699,7 @@ static int flexcan_chip_start(struct net_device *dev)
700 reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT | 699 reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT |
701 FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | 700 FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
702 FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS; 701 FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS;
703 dev_dbg(dev->dev.parent, "%s: writing mcr=0x%08x", __func__, reg_mcr); 702 netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr);
704 flexcan_write(reg_mcr, &regs->mcr); 703 flexcan_write(reg_mcr, &regs->mcr);
705 704
706 /* 705 /*
@@ -726,7 +725,7 @@ static int flexcan_chip_start(struct net_device *dev)
726 725
727 /* save for later use */ 726 /* save for later use */
728 priv->reg_ctrl_default = reg_ctrl; 727 priv->reg_ctrl_default = reg_ctrl;
729 dev_dbg(dev->dev.parent, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); 728 netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
730 flexcan_write(reg_ctrl, &regs->ctrl); 729 flexcan_write(reg_ctrl, &regs->ctrl);
731 730
732 for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) { 731 for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) {
@@ -758,8 +757,8 @@ static int flexcan_chip_start(struct net_device *dev)
758 flexcan_write(FLEXCAN_IFLAG_DEFAULT, &regs->imask1); 757 flexcan_write(FLEXCAN_IFLAG_DEFAULT, &regs->imask1);
759 758
760 /* print chip status */ 759 /* print chip status */
761 dev_dbg(dev->dev.parent, "%s: reading mcr=0x%08x ctrl=0x%08x\n", 760 netdev_dbg(dev, "%s: reading mcr=0x%08x ctrl=0x%08x\n", __func__,
762 __func__, flexcan_read(&regs->mcr), flexcan_read(&regs->ctrl)); 761 flexcan_read(&regs->mcr), flexcan_read(&regs->ctrl));
763 762
764 return 0; 763 return 0;
765 764
@@ -897,8 +896,7 @@ static int __devinit register_flexcandev(struct net_device *dev)
897 */ 896 */
898 reg = flexcan_read(&regs->mcr); 897 reg = flexcan_read(&regs->mcr);
899 if (!(reg & FLEXCAN_MCR_FEN)) { 898 if (!(reg & FLEXCAN_MCR_FEN)) {
900 dev_err(dev->dev.parent, 899 netdev_err(dev, "Could not enable RX FIFO, unsupported core\n");
901 "Could not enable RX FIFO, unsupported core\n");
902 err = -ENODEV; 900 err = -ENODEV;
903 goto out; 901 goto out;
904 } 902 }
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 330140ee266d..346785c56a25 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -712,8 +712,7 @@ static void mcp251x_error_skb(struct net_device *net, int can_id, int data1)
712 frame->data[1] = data1; 712 frame->data[1] = data1;
713 netif_rx_ni(skb); 713 netif_rx_ni(skb);
714 } else { 714 } else {
715 dev_err(&net->dev, 715 netdev_err(net, "cannot allocate error skb\n");
716 "cannot allocate error skb\n");
717 } 716 }
718} 717}
719 718
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index d11b0832ccd6..41a2a2dda7ea 100644
--- a/drivers/net/can/mscan/mscan.c
+++ b/drivers/net/can/mscan/mscan.c
@@ -95,9 +95,9 @@ static int mscan_set_mode(struct net_device *dev, u8 mode)
95 * any, at once. 95 * any, at once.
96 */ 96 */
97 if (i >= MSCAN_SET_MODE_RETRIES) 97 if (i >= MSCAN_SET_MODE_RETRIES)
98 dev_dbg(dev->dev.parent, 98 netdev_dbg(dev,
99 "device failed to enter sleep mode. " 99 "device failed to enter sleep mode. "
100 "We proceed anyhow.\n"); 100 "We proceed anyhow.\n");
101 else 101 else
102 priv->can.state = CAN_STATE_SLEEPING; 102 priv->can.state = CAN_STATE_SLEEPING;
103 } 103 }
@@ -213,7 +213,7 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev)
213 switch (hweight8(i)) { 213 switch (hweight8(i)) {
214 case 0: 214 case 0:
215 netif_stop_queue(dev); 215 netif_stop_queue(dev);
216 dev_err(dev->dev.parent, "Tx Ring full when queue awake!\n"); 216 netdev_err(dev, "Tx Ring full when queue awake!\n");
217 return NETDEV_TX_BUSY; 217 return NETDEV_TX_BUSY;
218 case 1: 218 case 1:
219 /* 219 /*
@@ -352,7 +352,7 @@ static void mscan_get_err_frame(struct net_device *dev, struct can_frame *frame,
352 struct net_device_stats *stats = &dev->stats; 352 struct net_device_stats *stats = &dev->stats;
353 enum can_state old_state; 353 enum can_state old_state;
354 354
355 dev_dbg(dev->dev.parent, "error interrupt (canrflg=%#x)\n", canrflg); 355 netdev_dbg(dev, "error interrupt (canrflg=%#x)\n", canrflg);
356 frame->can_id = CAN_ERR_FLAG; 356 frame->can_id = CAN_ERR_FLAG;
357 357
358 if (canrflg & MSCAN_OVRIF) { 358 if (canrflg & MSCAN_OVRIF) {
@@ -427,7 +427,7 @@ static int mscan_rx_poll(struct napi_struct *napi, int quota)
427 skb = alloc_can_skb(dev, &frame); 427 skb = alloc_can_skb(dev, &frame);
428 if (!skb) { 428 if (!skb) {
429 if (printk_ratelimit()) 429 if (printk_ratelimit())
430 dev_notice(dev->dev.parent, "packet dropped\n"); 430 netdev_notice(dev, "packet dropped\n");
431 stats->rx_dropped++; 431 stats->rx_dropped++;
432 out_8(&regs->canrflg, canrflg); 432 out_8(&regs->canrflg, canrflg);
433 continue; 433 continue;
@@ -551,8 +551,7 @@ static int mscan_do_set_bittiming(struct net_device *dev)
551 BTR1_SET_TSEG2(bt->phase_seg2) | 551 BTR1_SET_TSEG2(bt->phase_seg2) |
552 BTR1_SET_SAM(priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)); 552 BTR1_SET_SAM(priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES));
553 553
554 dev_info(dev->dev.parent, "setting BTR0=0x%02x BTR1=0x%02x\n", 554 netdev_info(dev, "setting BTR0=0x%02x BTR1=0x%02x\n", btr0, btr1);
555 btr0, btr1);
556 555
557 out_8(&regs->canbtr0, btr0); 556 out_8(&regs->canbtr0, btr0);
558 out_8(&regs->canbtr1, btr1); 557 out_8(&regs->canbtr1, btr1);
@@ -587,7 +586,7 @@ static int mscan_open(struct net_device *dev)
587 586
588 ret = request_irq(dev->irq, mscan_isr, 0, dev->name, dev); 587 ret = request_irq(dev->irq, mscan_isr, 0, dev->name, dev);
589 if (ret < 0) { 588 if (ret < 0) {
590 dev_err(dev->dev.parent, "failed to attach interrupt\n"); 589 netdev_err(dev, "failed to attach interrupt\n");
591 goto exit_napi_disable; 590 goto exit_napi_disable;
592 } 591 }
593 592
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 04a3f1b756a8..ebbcfcafe29b 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -128,7 +128,7 @@ static void set_reset_mode(struct net_device *dev)
128 status = priv->read_reg(priv, REG_MOD); 128 status = priv->read_reg(priv, REG_MOD);
129 } 129 }
130 130
131 dev_err(dev->dev.parent, "setting SJA1000 into reset mode failed!\n"); 131 netdev_err(dev, "setting SJA1000 into reset mode failed!\n");
132} 132}
133 133
134static void set_normal_mode(struct net_device *dev) 134static void set_normal_mode(struct net_device *dev)
@@ -156,7 +156,7 @@ static void set_normal_mode(struct net_device *dev)
156 status = priv->read_reg(priv, REG_MOD); 156 status = priv->read_reg(priv, REG_MOD);
157 } 157 }
158 158
159 dev_err(dev->dev.parent, "setting SJA1000 into normal mode failed!\n"); 159 netdev_err(dev, "setting SJA1000 into normal mode failed!\n");
160} 160}
161 161
162static void sja1000_start(struct net_device *dev) 162static void sja1000_start(struct net_device *dev)
@@ -209,8 +209,7 @@ static int sja1000_set_bittiming(struct net_device *dev)
209 if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) 209 if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
210 btr1 |= 0x80; 210 btr1 |= 0x80;
211 211
212 dev_info(dev->dev.parent, 212 netdev_info(dev, "setting BTR0=0x%02x BTR1=0x%02x\n", btr0, btr1);
213 "setting BTR0=0x%02x BTR1=0x%02x\n", btr0, btr1);
214 213
215 priv->write_reg(priv, REG_BTR0, btr0); 214 priv->write_reg(priv, REG_BTR0, btr0);
216 priv->write_reg(priv, REG_BTR1, btr1); 215 priv->write_reg(priv, REG_BTR1, btr1);
@@ -378,7 +377,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
378 377
379 if (isrc & IRQ_DOI) { 378 if (isrc & IRQ_DOI) {
380 /* data overrun interrupt */ 379 /* data overrun interrupt */
381 dev_dbg(dev->dev.parent, "data overrun interrupt\n"); 380 netdev_dbg(dev, "data overrun interrupt\n");
382 cf->can_id |= CAN_ERR_CRTL; 381 cf->can_id |= CAN_ERR_CRTL;
383 cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW; 382 cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
384 stats->rx_over_errors++; 383 stats->rx_over_errors++;
@@ -388,7 +387,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
388 387
389 if (isrc & IRQ_EI) { 388 if (isrc & IRQ_EI) {
390 /* error warning interrupt */ 389 /* error warning interrupt */
391 dev_dbg(dev->dev.parent, "error warning interrupt\n"); 390 netdev_dbg(dev, "error warning interrupt\n");
392 391
393 if (status & SR_BS) { 392 if (status & SR_BS) {
394 state = CAN_STATE_BUS_OFF; 393 state = CAN_STATE_BUS_OFF;
@@ -429,7 +428,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
429 } 428 }
430 if (isrc & IRQ_EPI) { 429 if (isrc & IRQ_EPI) {
431 /* error passive interrupt */ 430 /* error passive interrupt */
432 dev_dbg(dev->dev.parent, "error passive interrupt\n"); 431 netdev_dbg(dev, "error passive interrupt\n");
433 if (status & SR_ES) 432 if (status & SR_ES)
434 state = CAN_STATE_ERROR_PASSIVE; 433 state = CAN_STATE_ERROR_PASSIVE;
435 else 434 else
@@ -437,7 +436,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
437 } 436 }
438 if (isrc & IRQ_ALI) { 437 if (isrc & IRQ_ALI) {
439 /* arbitration lost interrupt */ 438 /* arbitration lost interrupt */
440 dev_dbg(dev->dev.parent, "arbitration lost interrupt\n"); 439 netdev_dbg(dev, "arbitration lost interrupt\n");
441 alc = priv->read_reg(priv, REG_ALC); 440 alc = priv->read_reg(priv, REG_ALC);
442 priv->can.can_stats.arbitration_lost++; 441 priv->can.can_stats.arbitration_lost++;
443 stats->tx_errors++; 442 stats->tx_errors++;
@@ -495,7 +494,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
495 status = priv->read_reg(priv, REG_SR); 494 status = priv->read_reg(priv, REG_SR);
496 495
497 if (isrc & IRQ_WUI) 496 if (isrc & IRQ_WUI)
498 dev_warn(dev->dev.parent, "wakeup interrupt\n"); 497 netdev_warn(dev, "wakeup interrupt\n");
499 498
500 if (isrc & IRQ_TI) { 499 if (isrc & IRQ_TI) {
501 /* transmission complete interrupt */ 500 /* transmission complete interrupt */
@@ -522,7 +521,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
522 priv->post_irq(priv); 521 priv->post_irq(priv);
523 522
524 if (n >= SJA1000_MAX_IRQ) 523 if (n >= SJA1000_MAX_IRQ)
525 dev_dbg(dev->dev.parent, "%d messages handled in ISR", n); 524 netdev_dbg(dev, "%d messages handled in ISR", n);
526 525
527 return (n) ? IRQ_HANDLED : IRQ_NONE; 526 return (n) ? IRQ_HANDLED : IRQ_NONE;
528} 527}
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index aee925ab0de8..0d18a9319720 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -306,7 +306,7 @@ static int ti_hecc_set_btc(struct ti_hecc_priv *priv)
306 if (bit_timing->brp > 4) 306 if (bit_timing->brp > 4)
307 can_btc |= HECC_CANBTC_SAM; 307 can_btc |= HECC_CANBTC_SAM;
308 else 308 else
309 dev_warn(priv->ndev->dev.parent, "WARN: Triple" \ 309 netdev_warn(priv->ndev, "WARN: Triple"
310 "sampling not set due to h/w limitations"); 310 "sampling not set due to h/w limitations");
311 } 311 }
312 can_btc |= ((bit_timing->sjw - 1) & 0x3) << 8; 312 can_btc |= ((bit_timing->sjw - 1) & 0x3) << 8;
@@ -315,7 +315,7 @@ static int ti_hecc_set_btc(struct ti_hecc_priv *priv)
315 /* ERM being set to 0 by default meaning resync at falling edge */ 315 /* ERM being set to 0 by default meaning resync at falling edge */
316 316
317 hecc_write(priv, HECC_CANBTC, can_btc); 317 hecc_write(priv, HECC_CANBTC, can_btc);
318 dev_info(priv->ndev->dev.parent, "setting CANBTC=%#x\n", can_btc); 318 netdev_info(priv->ndev, "setting CANBTC=%#x\n", can_btc);
319 319
320 return 0; 320 return 0;
321} 321}
@@ -332,7 +332,7 @@ static void ti_hecc_reset(struct net_device *ndev)
332 u32 cnt; 332 u32 cnt;
333 struct ti_hecc_priv *priv = netdev_priv(ndev); 333 struct ti_hecc_priv *priv = netdev_priv(ndev);
334 334
335 dev_dbg(ndev->dev.parent, "resetting hecc ...\n"); 335 netdev_dbg(ndev, "resetting hecc ...\n");
336 hecc_set_bit(priv, HECC_CANMC, HECC_CANMC_SRES); 336 hecc_set_bit(priv, HECC_CANMC, HECC_CANMC_SRES);
337 337
338 /* Set change control request and wait till enabled */ 338 /* Set change control request and wait till enabled */
@@ -507,7 +507,7 @@ static netdev_tx_t ti_hecc_xmit(struct sk_buff *skb, struct net_device *ndev)
507 if (unlikely(hecc_read(priv, HECC_CANME) & mbx_mask)) { 507 if (unlikely(hecc_read(priv, HECC_CANME) & mbx_mask)) {
508 spin_unlock_irqrestore(&priv->mbx_lock, flags); 508 spin_unlock_irqrestore(&priv->mbx_lock, flags);
509 netif_stop_queue(ndev); 509 netif_stop_queue(ndev);
510 dev_err(priv->ndev->dev.parent, 510 netdev_err(priv->ndev,
511 "BUG: TX mbx not ready tx_head=%08X, tx_tail=%08X\n", 511 "BUG: TX mbx not ready tx_head=%08X, tx_tail=%08X\n",
512 priv->tx_head, priv->tx_tail); 512 priv->tx_head, priv->tx_tail);
513 return NETDEV_TX_BUSY; 513 return NETDEV_TX_BUSY;
@@ -561,7 +561,7 @@ static int ti_hecc_rx_pkt(struct ti_hecc_priv *priv, int mbxno)
561 skb = alloc_can_skb(priv->ndev, &cf); 561 skb = alloc_can_skb(priv->ndev, &cf);
562 if (!skb) { 562 if (!skb) {
563 if (printk_ratelimit()) 563 if (printk_ratelimit())
564 dev_err(priv->ndev->dev.parent, 564 netdev_err(priv->ndev,
565 "ti_hecc_rx_pkt: alloc_can_skb() failed\n"); 565 "ti_hecc_rx_pkt: alloc_can_skb() failed\n");
566 return -ENOMEM; 566 return -ENOMEM;
567 } 567 }
@@ -679,7 +679,7 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
679 skb = alloc_can_err_skb(ndev, &cf); 679 skb = alloc_can_err_skb(ndev, &cf);
680 if (!skb) { 680 if (!skb) {
681 if (printk_ratelimit()) 681 if (printk_ratelimit())
682 dev_err(priv->ndev->dev.parent, 682 netdev_err(priv->ndev,
683 "ti_hecc_error: alloc_can_err_skb() failed\n"); 683 "ti_hecc_error: alloc_can_err_skb() failed\n");
684 return -ENOMEM; 684 return -ENOMEM;
685 } 685 }
@@ -695,7 +695,7 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
695 cf->data[1] |= CAN_ERR_CRTL_RX_WARNING; 695 cf->data[1] |= CAN_ERR_CRTL_RX_WARNING;
696 } 696 }
697 hecc_set_bit(priv, HECC_CANES, HECC_CANES_EW); 697 hecc_set_bit(priv, HECC_CANES, HECC_CANES_EW);
698 dev_dbg(priv->ndev->dev.parent, "Error Warning interrupt\n"); 698 netdev_dbg(priv->ndev, "Error Warning interrupt\n");
699 hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_CCR); 699 hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_CCR);
700 } 700 }
701 701
@@ -710,7 +710,7 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
710 cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE; 710 cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
711 } 711 }
712 hecc_set_bit(priv, HECC_CANES, HECC_CANES_EP); 712 hecc_set_bit(priv, HECC_CANES, HECC_CANES_EP);
713 dev_dbg(priv->ndev->dev.parent, "Error passive interrupt\n"); 713 netdev_dbg(priv->ndev, "Error passive interrupt\n");
714 hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_CCR); 714 hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_CCR);
715 } 715 }
716 716
@@ -835,7 +835,7 @@ static int ti_hecc_open(struct net_device *ndev)
835 err = request_irq(ndev->irq, ti_hecc_interrupt, IRQF_SHARED, 835 err = request_irq(ndev->irq, ti_hecc_interrupt, IRQF_SHARED,
836 ndev->name, ndev); 836 ndev->name, ndev);
837 if (err) { 837 if (err) {
838 dev_err(ndev->dev.parent, "error requesting interrupt\n"); 838 netdev_err(ndev, "error requesting interrupt\n");
839 return err; 839 return err;
840 } 840 }
841 841
@@ -844,7 +844,7 @@ static int ti_hecc_open(struct net_device *ndev)
844 /* Open common can device */ 844 /* Open common can device */
845 err = open_candev(ndev); 845 err = open_candev(ndev);
846 if (err) { 846 if (err) {
847 dev_err(ndev->dev.parent, "open_candev() failed %d\n", err); 847 netdev_err(ndev, "open_candev() failed %d\n", err);
848 ti_hecc_transceiver_switch(priv, 0); 848 ti_hecc_transceiver_switch(priv, 0);
849 free_irq(ndev->irq, ndev); 849 free_irq(ndev->irq, ndev);
850 return err; 850 return err;
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 9783e02fbc26..7ae65fc80032 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -288,8 +288,7 @@ static void ems_usb_read_interrupt_callback(struct urb *urb)
288 return; 288 return;
289 289
290 default: 290 default:
291 dev_info(netdev->dev.parent, "Rx interrupt aborted %d\n", 291 netdev_info(netdev, "Rx interrupt aborted %d\n", urb->status);
292 urb->status);
293 break; 292 break;
294 } 293 }
295 294
@@ -298,8 +297,7 @@ static void ems_usb_read_interrupt_callback(struct urb *urb)
298 if (err == -ENODEV) 297 if (err == -ENODEV)
299 netif_device_detach(netdev); 298 netif_device_detach(netdev);
300 else if (err) 299 else if (err)
301 dev_err(netdev->dev.parent, 300 netdev_err(netdev, "failed resubmitting intr urb: %d\n", err);
302 "failed resubmitting intr urb: %d\n", err);
303} 301}
304 302
305static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg) 303static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
@@ -431,8 +429,7 @@ static void ems_usb_read_bulk_callback(struct urb *urb)
431 return; 429 return;
432 430
433 default: 431 default:
434 dev_info(netdev->dev.parent, "Rx URB aborted (%d)\n", 432 netdev_info(netdev, "Rx URB aborted (%d)\n", urb->status);
435 urb->status);
436 goto resubmit_urb; 433 goto resubmit_urb;
437 } 434 }
438 435
@@ -477,7 +474,7 @@ static void ems_usb_read_bulk_callback(struct urb *urb)
477 msg_count--; 474 msg_count--;
478 475
479 if (start > urb->transfer_buffer_length) { 476 if (start > urb->transfer_buffer_length) {
480 dev_err(netdev->dev.parent, "format error\n"); 477 netdev_err(netdev, "format error\n");
481 break; 478 break;
482 } 479 }
483 } 480 }
@@ -493,8 +490,8 @@ resubmit_urb:
493 if (retval == -ENODEV) 490 if (retval == -ENODEV)
494 netif_device_detach(netdev); 491 netif_device_detach(netdev);
495 else if (retval) 492 else if (retval)
496 dev_err(netdev->dev.parent, 493 netdev_err(netdev,
497 "failed resubmitting read bulk urb: %d\n", retval); 494 "failed resubmitting read bulk urb: %d\n", retval);
498} 495}
499 496
500/* 497/*
@@ -521,8 +518,7 @@ static void ems_usb_write_bulk_callback(struct urb *urb)
521 return; 518 return;
522 519
523 if (urb->status) 520 if (urb->status)
524 dev_info(netdev->dev.parent, "Tx URB aborted (%d)\n", 521 netdev_info(netdev, "Tx URB aborted (%d)\n", urb->status);
525 urb->status);
526 522
527 netdev->trans_start = jiffies; 523 netdev->trans_start = jiffies;
528 524
@@ -605,8 +601,7 @@ static int ems_usb_start(struct ems_usb *dev)
605 /* create a URB, and a buffer for it */ 601 /* create a URB, and a buffer for it */
606 urb = usb_alloc_urb(0, GFP_KERNEL); 602 urb = usb_alloc_urb(0, GFP_KERNEL);
607 if (!urb) { 603 if (!urb) {
608 dev_err(netdev->dev.parent, 604 netdev_err(netdev, "No memory left for URBs\n");
609 "No memory left for URBs\n");
610 err = -ENOMEM; 605 err = -ENOMEM;
611 break; 606 break;
612 } 607 }
@@ -614,8 +609,7 @@ static int ems_usb_start(struct ems_usb *dev)
614 buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL, 609 buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL,
615 &urb->transfer_dma); 610 &urb->transfer_dma);
616 if (!buf) { 611 if (!buf) {
617 dev_err(netdev->dev.parent, 612 netdev_err(netdev, "No memory left for USB buffer\n");
618 "No memory left for USB buffer\n");
619 usb_free_urb(urb); 613 usb_free_urb(urb);
620 err = -ENOMEM; 614 err = -ENOMEM;
621 break; 615 break;
@@ -641,13 +635,13 @@ static int ems_usb_start(struct ems_usb *dev)
641 635
642 /* Did we submit any URBs */ 636 /* Did we submit any URBs */
643 if (i == 0) { 637 if (i == 0) {
644 dev_warn(netdev->dev.parent, "couldn't setup read URBs\n"); 638 netdev_warn(netdev, "couldn't setup read URBs\n");
645 return err; 639 return err;
646 } 640 }
647 641
648 /* Warn if we've couldn't transmit all the URBs */ 642 /* Warn if we've couldn't transmit all the URBs */
649 if (i < MAX_RX_URBS) 643 if (i < MAX_RX_URBS)
650 dev_warn(netdev->dev.parent, "rx performance may be slow\n"); 644 netdev_warn(netdev, "rx performance may be slow\n");
651 645
652 /* Setup and start interrupt URB */ 646 /* Setup and start interrupt URB */
653 usb_fill_int_urb(dev->intr_urb, dev->udev, 647 usb_fill_int_urb(dev->intr_urb, dev->udev,
@@ -658,8 +652,7 @@ static int ems_usb_start(struct ems_usb *dev)
658 652
659 err = usb_submit_urb(dev->intr_urb, GFP_KERNEL); 653 err = usb_submit_urb(dev->intr_urb, GFP_KERNEL);
660 if (err) { 654 if (err) {
661 dev_warn(netdev->dev.parent, "intr URB submit failed: %d\n", 655 netdev_warn(netdev, "intr URB submit failed: %d\n", err);
662 err);
663 656
664 return err; 657 return err;
665 } 658 }
@@ -688,7 +681,7 @@ static int ems_usb_start(struct ems_usb *dev)
688 return 0; 681 return 0;
689 682
690failed: 683failed:
691 dev_warn(netdev->dev.parent, "couldn't submit control: %d\n", err); 684 netdev_warn(netdev, "couldn't submit control: %d\n", err);
692 685
693 return err; 686 return err;
694} 687}
@@ -728,8 +721,7 @@ static int ems_usb_open(struct net_device *netdev)
728 if (err == -ENODEV) 721 if (err == -ENODEV)
729 netif_device_detach(dev->netdev); 722 netif_device_detach(dev->netdev);
730 723
731 dev_warn(netdev->dev.parent, "couldn't start device: %d\n", 724 netdev_warn(netdev, "couldn't start device: %d\n", err);
732 err);
733 725
734 close_candev(netdev); 726 close_candev(netdev);
735 727
@@ -762,13 +754,13 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
762 /* create a URB, and a buffer for it, and copy the data to the URB */ 754 /* create a URB, and a buffer for it, and copy the data to the URB */
763 urb = usb_alloc_urb(0, GFP_ATOMIC); 755 urb = usb_alloc_urb(0, GFP_ATOMIC);
764 if (!urb) { 756 if (!urb) {
765 dev_err(netdev->dev.parent, "No memory left for URBs\n"); 757 netdev_err(netdev, "No memory left for URBs\n");
766 goto nomem; 758 goto nomem;
767 } 759 }
768 760
769 buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma); 761 buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma);
770 if (!buf) { 762 if (!buf) {
771 dev_err(netdev->dev.parent, "No memory left for USB buffer\n"); 763 netdev_err(netdev, "No memory left for USB buffer\n");
772 usb_free_urb(urb); 764 usb_free_urb(urb);
773 goto nomem; 765 goto nomem;
774 } 766 }
@@ -811,7 +803,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
811 usb_unanchor_urb(urb); 803 usb_unanchor_urb(urb);
812 usb_free_coherent(dev->udev, size, buf, urb->transfer_dma); 804 usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
813 805
814 dev_warn(netdev->dev.parent, "couldn't find free context\n"); 806 netdev_warn(netdev, "couldn't find free context\n");
815 807
816 return NETDEV_TX_BUSY; 808 return NETDEV_TX_BUSY;
817 } 809 }
@@ -842,7 +834,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
842 if (err == -ENODEV) { 834 if (err == -ENODEV) {
843 netif_device_detach(netdev); 835 netif_device_detach(netdev);
844 } else { 836 } else {
845 dev_warn(netdev->dev.parent, "failed tx_urb %d\n", err); 837 netdev_warn(netdev, "failed tx_urb %d\n", err);
846 838
847 stats->tx_dropped++; 839 stats->tx_dropped++;
848 } 840 }
@@ -882,7 +874,7 @@ static int ems_usb_close(struct net_device *netdev)
882 874
883 /* Set CAN controller to reset mode */ 875 /* Set CAN controller to reset mode */
884 if (ems_usb_write_mode(dev, SJA1000_MOD_RM)) 876 if (ems_usb_write_mode(dev, SJA1000_MOD_RM))
885 dev_warn(netdev->dev.parent, "couldn't stop device"); 877 netdev_warn(netdev, "couldn't stop device");
886 878
887 close_candev(netdev); 879 close_candev(netdev);
888 880
@@ -919,7 +911,7 @@ static int ems_usb_set_mode(struct net_device *netdev, enum can_mode mode)
919 switch (mode) { 911 switch (mode) {
920 case CAN_MODE_START: 912 case CAN_MODE_START:
921 if (ems_usb_write_mode(dev, SJA1000_MOD_NORMAL)) 913 if (ems_usb_write_mode(dev, SJA1000_MOD_NORMAL))
922 dev_warn(netdev->dev.parent, "couldn't start device"); 914 netdev_warn(netdev, "couldn't start device");
923 915
924 if (netif_queue_stopped(netdev)) 916 if (netif_queue_stopped(netdev))
925 netif_wake_queue(netdev); 917 netif_wake_queue(netdev);
@@ -944,8 +936,7 @@ static int ems_usb_set_bittiming(struct net_device *netdev)
944 if (dev->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) 936 if (dev->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
945 btr1 |= 0x80; 937 btr1 |= 0x80;
946 938
947 dev_info(netdev->dev.parent, "setting BTR0=0x%02x BTR1=0x%02x\n", 939 netdev_info(netdev, "setting BTR0=0x%02x BTR1=0x%02x\n", btr0, btr1);
948 btr0, btr1);
949 940
950 dev->active_params.msg.can_params.cc_params.sja1000.btr0 = btr0; 941 dev->active_params.msg.can_params.cc_params.sja1000.btr0 = btr0;
951 dev->active_params.msg.can_params.cc_params.sja1000.btr1 = btr1; 942 dev->active_params.msg.can_params.cc_params.sja1000.btr1 = btr1;
@@ -1050,15 +1041,13 @@ static int ems_usb_probe(struct usb_interface *intf,
1050 1041
1051 err = ems_usb_command_msg(dev, &dev->active_params); 1042 err = ems_usb_command_msg(dev, &dev->active_params);
1052 if (err) { 1043 if (err) {
1053 dev_err(netdev->dev.parent, 1044 netdev_err(netdev, "couldn't initialize controller: %d\n", err);
1054 "couldn't initialize controller: %d\n", err);
1055 goto cleanup_tx_msg_buffer; 1045 goto cleanup_tx_msg_buffer;
1056 } 1046 }
1057 1047
1058 err = register_candev(netdev); 1048 err = register_candev(netdev);
1059 if (err) { 1049 if (err) {
1060 dev_err(netdev->dev.parent, 1050 netdev_err(netdev, "couldn't register CAN device: %d\n", err);
1061 "couldn't register CAN device: %d\n", err);
1062 goto cleanup_tx_msg_buffer; 1051 goto cleanup_tx_msg_buffer;
1063 } 1052 }
1064 1053
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index 92774637aad8..09b1da5bc512 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -470,8 +470,7 @@ static void esd_usb2_write_bulk_callback(struct urb *urb)
470 return; 470 return;
471 471
472 if (urb->status) 472 if (urb->status)
473 dev_info(netdev->dev.parent, "Tx URB aborted (%d)\n", 473 netdev_info(netdev, "Tx URB aborted (%d)\n", urb->status);
474 urb->status);
475 474
476 netdev->trans_start = jiffies; 475 netdev->trans_start = jiffies;
477} 476}
@@ -651,7 +650,7 @@ failed:
651 if (err == -ENODEV) 650 if (err == -ENODEV)
652 netif_device_detach(netdev); 651 netif_device_detach(netdev);
653 652
654 dev_err(netdev->dev.parent, "couldn't start device: %d\n", err); 653 netdev_err(netdev, "couldn't start device: %d\n", err);
655 654
656 return err; 655 return err;
657} 656}
@@ -687,8 +686,7 @@ static int esd_usb2_open(struct net_device *netdev)
687 /* finally start device */ 686 /* finally start device */
688 err = esd_usb2_start(priv); 687 err = esd_usb2_start(priv);
689 if (err) { 688 if (err) {
690 dev_warn(netdev->dev.parent, 689 netdev_warn(netdev, "couldn't start device: %d\n", err);
691 "couldn't start device: %d\n", err);
692 close_candev(netdev); 690 close_candev(netdev);
693 return err; 691 return err;
694 } 692 }
@@ -721,7 +719,7 @@ static netdev_tx_t esd_usb2_start_xmit(struct sk_buff *skb,
721 /* create a URB, and a buffer for it, and copy the data to the URB */ 719 /* create a URB, and a buffer for it, and copy the data to the URB */
722 urb = usb_alloc_urb(0, GFP_ATOMIC); 720 urb = usb_alloc_urb(0, GFP_ATOMIC);
723 if (!urb) { 721 if (!urb) {
724 dev_err(netdev->dev.parent, "No memory left for URBs\n"); 722 netdev_err(netdev, "No memory left for URBs\n");
725 stats->tx_dropped++; 723 stats->tx_dropped++;
726 dev_kfree_skb(skb); 724 dev_kfree_skb(skb);
727 goto nourbmem; 725 goto nourbmem;
@@ -730,7 +728,7 @@ static netdev_tx_t esd_usb2_start_xmit(struct sk_buff *skb,
730 buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, 728 buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC,
731 &urb->transfer_dma); 729 &urb->transfer_dma);
732 if (!buf) { 730 if (!buf) {
733 dev_err(netdev->dev.parent, "No memory left for USB buffer\n"); 731 netdev_err(netdev, "No memory left for USB buffer\n");
734 stats->tx_dropped++; 732 stats->tx_dropped++;
735 dev_kfree_skb(skb); 733 dev_kfree_skb(skb);
736 goto nobufmem; 734 goto nobufmem;
@@ -766,7 +764,7 @@ static netdev_tx_t esd_usb2_start_xmit(struct sk_buff *skb,
766 * This may never happen. 764 * This may never happen.
767 */ 765 */
768 if (!context) { 766 if (!context) {
769 dev_warn(netdev->dev.parent, "couldn't find free context\n"); 767 netdev_warn(netdev, "couldn't find free context\n");
770 ret = NETDEV_TX_BUSY; 768 ret = NETDEV_TX_BUSY;
771 goto releasebuf; 769 goto releasebuf;
772 } 770 }
@@ -806,7 +804,7 @@ static netdev_tx_t esd_usb2_start_xmit(struct sk_buff *skb,
806 if (err == -ENODEV) 804 if (err == -ENODEV)
807 netif_device_detach(netdev); 805 netif_device_detach(netdev);
808 else 806 else
809 dev_warn(netdev->dev.parent, "failed tx_urb %d\n", err); 807 netdev_warn(netdev, "failed tx_urb %d\n", err);
810 808
811 goto releasebuf; 809 goto releasebuf;
812 } 810 }
@@ -845,7 +843,7 @@ static int esd_usb2_close(struct net_device *netdev)
845 for (i = 0; i <= ESD_MAX_ID_SEGMENT; i++) 843 for (i = 0; i <= ESD_MAX_ID_SEGMENT; i++)
846 msg.msg.filter.mask[i] = 0; 844 msg.msg.filter.mask[i] = 0;
847 if (esd_usb2_send_msg(priv->usb2, &msg) < 0) 845 if (esd_usb2_send_msg(priv->usb2, &msg) < 0)
848 dev_err(netdev->dev.parent, "sending idadd message failed\n"); 846 netdev_err(netdev, "sending idadd message failed\n");
849 847
850 /* set CAN controller to reset mode */ 848 /* set CAN controller to reset mode */
851 msg.msg.hdr.len = 2; 849 msg.msg.hdr.len = 2;
@@ -854,7 +852,7 @@ static int esd_usb2_close(struct net_device *netdev)
854 msg.msg.setbaud.rsvd = 0; 852 msg.msg.setbaud.rsvd = 0;
855 msg.msg.setbaud.baud = cpu_to_le32(ESD_USB2_NO_BAUDRATE); 853 msg.msg.setbaud.baud = cpu_to_le32(ESD_USB2_NO_BAUDRATE);
856 if (esd_usb2_send_msg(priv->usb2, &msg) < 0) 854 if (esd_usb2_send_msg(priv->usb2, &msg) < 0)
857 dev_err(netdev->dev.parent, "sending setbaud message failed\n"); 855 netdev_err(netdev, "sending setbaud message failed\n");
858 856
859 priv->can.state = CAN_STATE_STOPPED; 857 priv->can.state = CAN_STATE_STOPPED;
860 858
@@ -910,7 +908,7 @@ static int esd_usb2_set_bittiming(struct net_device *netdev)
910 msg.msg.setbaud.rsvd = 0; 908 msg.msg.setbaud.rsvd = 0;
911 msg.msg.setbaud.baud = cpu_to_le32(canbtr); 909 msg.msg.setbaud.baud = cpu_to_le32(canbtr);
912 910
913 dev_info(netdev->dev.parent, "setting BTR=%#x\n", canbtr); 911 netdev_info(netdev, "setting BTR=%#x\n", canbtr);
914 912
915 return esd_usb2_send_msg(priv->usb2, &msg); 913 return esd_usb2_send_msg(priv->usb2, &msg);
916} 914}
@@ -988,15 +986,14 @@ static int esd_usb2_probe_one_net(struct usb_interface *intf, int index)
988 986
989 err = register_candev(netdev); 987 err = register_candev(netdev);
990 if (err) { 988 if (err) {
991 dev_err(&intf->dev, 989 dev_err(&intf->dev, "couldn't register CAN device: %d\n", err);
992 "couldn't register CAN device: %d\n", err);
993 free_candev(netdev); 990 free_candev(netdev);
994 err = -ENOMEM; 991 err = -ENOMEM;
995 goto done; 992 goto done;
996 } 993 }
997 994
998 dev->nets[index] = priv; 995 dev->nets[index] = priv;
999 dev_info(netdev->dev.parent, "device %s registered\n", netdev->name); 996 netdev_info(netdev, "device %s registered\n", netdev->name);
1000 997
1001done: 998done:
1002 return err; 999 return err;