aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/nsc-ircc.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-11-11 16:37:30 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-11 18:11:00 -0500
commit6c91023dc35c88d5e6aebe4bfe6f1ed5ec2b84be (patch)
tree2f33e40962dd622ae926ff7e8284f3ef540d3ca9 /drivers/net/irda/nsc-ircc.c
parent09626e9d153326ca82568e4e27f2daa53713992e (diff)
irda: Remove IRDA_<TYPE> logging macros
And use the more common mechanisms directly. Other miscellanea: o Coalesce formats o Add missing newlines o Realign arguments o Remove unnecessary OOM message logging as there's a generic stack dump already on OOM. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda/nsc-ircc.c')
-rw-r--r--drivers/net/irda/nsc-ircc.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 66bc03bdb138..c0a179098ea5 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -211,7 +211,8 @@ static int __init nsc_ircc_init(void)
211 211
212 ret = platform_driver_register(&nsc_ircc_driver); 212 ret = platform_driver_register(&nsc_ircc_driver);
213 if (ret) { 213 if (ret) {
214 IRDA_ERROR("%s, Can't register driver!\n", driver_name); 214 net_err_ratelimited("%s, Can't register driver!\n",
215 driver_name);
215 return ret; 216 return ret;
216 } 217 }
217 218
@@ -260,7 +261,8 @@ static int __init nsc_ircc_init(void)
260 info.irq = pnp_info.irq; 261 info.irq = pnp_info.irq;
261 262
262 if (info.fir_base < 0x2000) { 263 if (info.fir_base < 0x2000) {
263 IRDA_MESSAGE("%s, chip->init\n", driver_name); 264 net_info_ratelimited("%s, chip->init\n",
265 driver_name);
264 chip->init(chip, &info); 266 chip->init(chip, &info);
265 } else 267 } else
266 chip->probe(chip, &info); 268 chip->probe(chip, &info);
@@ -370,22 +372,23 @@ static int __init nsc_ircc_open(chipio_t *info)
370 } 372 }
371 373
372 if (chip_index == ARRAY_SIZE(dev_self)) { 374 if (chip_index == ARRAY_SIZE(dev_self)) {
373 IRDA_ERROR("%s(), maximum number of supported chips reached!\n", __func__); 375 net_err_ratelimited("%s(), maximum number of supported chips reached!\n",
376 __func__);
374 return -ENOMEM; 377 return -ENOMEM;
375 } 378 }
376 379
377 IRDA_MESSAGE("%s, Found chip at base=0x%03x\n", driver_name, 380 net_info_ratelimited("%s, Found chip at base=0x%03x\n",
378 info->cfg_base); 381 driver_name, info->cfg_base);
379 382
380 if ((nsc_ircc_setup(info)) == -1) 383 if ((nsc_ircc_setup(info)) == -1)
381 return -1; 384 return -1;
382 385
383 IRDA_MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name); 386 net_info_ratelimited("%s, driver loaded (Dag Brattli)\n", driver_name);
384 387
385 dev = alloc_irdadev(sizeof(struct nsc_ircc_cb)); 388 dev = alloc_irdadev(sizeof(struct nsc_ircc_cb));
386 if (dev == NULL) { 389 if (dev == NULL) {
387 IRDA_ERROR("%s(), can't allocate memory for " 390 net_err_ratelimited("%s(), can't allocate memory for control block!\n",
388 "control block!\n", __func__); 391 __func__);
389 return -ENOMEM; 392 return -ENOMEM;
390 } 393 }
391 394
@@ -408,8 +411,8 @@ static int __init nsc_ircc_open(chipio_t *info)
408 /* Reserve the ioports that we need */ 411 /* Reserve the ioports that we need */
409 ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name); 412 ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name);
410 if (!ret) { 413 if (!ret) {
411 IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", 414 net_warn_ratelimited("%s(), can't get iobase of 0x%03x\n",
412 __func__, self->io.fir_base); 415 __func__, self->io.fir_base);
413 err = -ENODEV; 416 err = -ENODEV;
414 goto out1; 417 goto out1;
415 } 418 }
@@ -460,21 +463,22 @@ static int __init nsc_ircc_open(chipio_t *info)
460 463
461 err = register_netdev(dev); 464 err = register_netdev(dev);
462 if (err) { 465 if (err) {
463 IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); 466 net_err_ratelimited("%s(), register_netdev() failed!\n",
467 __func__);
464 goto out4; 468 goto out4;
465 } 469 }
466 IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); 470 net_info_ratelimited("IrDA: Registered device %s\n", dev->name);
467 471
468 /* Check if user has supplied a valid dongle id or not */ 472 /* Check if user has supplied a valid dongle id or not */
469 if ((dongle_id <= 0) || 473 if ((dongle_id <= 0) ||
470 (dongle_id >= ARRAY_SIZE(dongle_types))) { 474 (dongle_id >= ARRAY_SIZE(dongle_types))) {
471 dongle_id = nsc_ircc_read_dongle_id(self->io.fir_base); 475 dongle_id = nsc_ircc_read_dongle_id(self->io.fir_base);
472 476
473 IRDA_MESSAGE("%s, Found dongle: %s\n", driver_name, 477 net_info_ratelimited("%s, Found dongle: %s\n",
474 dongle_types[dongle_id]); 478 driver_name, dongle_types[dongle_id]);
475 } else { 479 } else {
476 IRDA_MESSAGE("%s, Using dongle: %s\n", driver_name, 480 net_info_ratelimited("%s, Using dongle: %s\n",
477 dongle_types[dongle_id]); 481 driver_name, dongle_types[dongle_id]);
478 } 482 }
479 483
480 self->io.dongle_id = dongle_id; 484 self->io.dongle_id = dongle_id;
@@ -567,7 +571,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
567 case 0x2e8: outb(0x15, cfg_base+1); break; 571 case 0x2e8: outb(0x15, cfg_base+1); break;
568 case 0x3f8: outb(0x16, cfg_base+1); break; 572 case 0x3f8: outb(0x16, cfg_base+1); break;
569 case 0x2f8: outb(0x17, cfg_base+1); break; 573 case 0x2f8: outb(0x17, cfg_base+1); break;
570 default: IRDA_ERROR("%s(), invalid base_address", __func__); 574 default: net_err_ratelimited("%s(), invalid base_address\n", __func__);
571 } 575 }
572 576
573 /* Control Signal Routing Register (CSRT) */ 577 /* Control Signal Routing Register (CSRT) */
@@ -579,7 +583,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
579 case 9: temp = 0x05; break; 583 case 9: temp = 0x05; break;
580 case 11: temp = 0x06; break; 584 case 11: temp = 0x06; break;
581 case 15: temp = 0x07; break; 585 case 15: temp = 0x07; break;
582 default: IRDA_ERROR("%s(), invalid irq", __func__); 586 default: net_err_ratelimited("%s(), invalid irq\n", __func__);
583 } 587 }
584 outb(CFG_108_CSRT, cfg_base); 588 outb(CFG_108_CSRT, cfg_base);
585 589
@@ -587,7 +591,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info)
587 case 0: outb(0x08+temp, cfg_base+1); break; 591 case 0: outb(0x08+temp, cfg_base+1); break;
588 case 1: outb(0x10+temp, cfg_base+1); break; 592 case 1: outb(0x10+temp, cfg_base+1); break;
589 case 3: outb(0x18+temp, cfg_base+1); break; 593 case 3: outb(0x18+temp, cfg_base+1); break;
590 default: IRDA_ERROR("%s(), invalid dma", __func__); 594 default: net_err_ratelimited("%s(), invalid dma\n", __func__);
591 } 595 }
592 596
593 outb(CFG_108_MCTL, cfg_base); /* Mode Control Register (MCTL) */ 597 outb(CFG_108_MCTL, cfg_base); /* Mode Control Register (MCTL) */
@@ -993,8 +997,8 @@ static int nsc_ircc_setup(chipio_t *info)
993 997
994 /* Should be 0x2? */ 998 /* Should be 0x2? */
995 if (0x20 != (version & 0xf0)) { 999 if (0x20 != (version & 0xf0)) {
996 IRDA_ERROR("%s, Wrong chip version %02x\n", 1000 net_err_ratelimited("%s, Wrong chip version %02x\n",
997 driver_name, version); 1001 driver_name, version);
998 return -1; 1002 return -1;
999 } 1003 }
1000 1004
@@ -1872,9 +1876,6 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
1872 1876
1873 skb = dev_alloc_skb(len+1); 1877 skb = dev_alloc_skb(len+1);
1874 if (skb == NULL) { 1878 if (skb == NULL) {
1875 IRDA_WARNING("%s(), memory squeeze, "
1876 "dropping frame.\n",
1877 __func__);
1878 self->netdev->stats.rx_dropped++; 1879 self->netdev->stats.rx_dropped++;
1879 1880
1880 /* Restore bank register */ 1881 /* Restore bank register */
@@ -2063,9 +2064,8 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase,
2063 nsc_ircc_dma_receive(self); 2064 nsc_ircc_dma_receive(self);
2064 self->ier = IER_SFIF_IE; 2065 self->ier = IER_SFIF_IE;
2065 } else 2066 } else
2066 IRDA_WARNING("%s(), potential " 2067 net_warn_ratelimited("%s(), potential Tx queue lockup !\n",
2067 "Tx queue lockup !\n", 2068 __func__);
2068 __func__);
2069 } 2069 }
2070 } else { 2070 } else {
2071 /* Not finished yet, so interrupt on DMA again */ 2071 /* Not finished yet, so interrupt on DMA again */
@@ -2184,8 +2184,8 @@ static int nsc_ircc_net_open(struct net_device *dev)
2184 iobase = self->io.fir_base; 2184 iobase = self->io.fir_base;
2185 2185
2186 if (request_irq(self->io.irq, nsc_ircc_interrupt, 0, dev->name, dev)) { 2186 if (request_irq(self->io.irq, nsc_ircc_interrupt, 0, dev->name, dev)) {
2187 IRDA_WARNING("%s, unable to allocate irq=%d\n", 2187 net_warn_ratelimited("%s, unable to allocate irq=%d\n",
2188 driver_name, self->io.irq); 2188 driver_name, self->io.irq);
2189 return -EAGAIN; 2189 return -EAGAIN;
2190 } 2190 }
2191 /* 2191 /*
@@ -2193,8 +2193,8 @@ static int nsc_ircc_net_open(struct net_device *dev)
2193 * failure. 2193 * failure.
2194 */ 2194 */
2195 if (request_dma(self->io.dma, dev->name)) { 2195 if (request_dma(self->io.dma, dev->name)) {
2196 IRDA_WARNING("%s, unable to allocate dma=%d\n", 2196 net_warn_ratelimited("%s, unable to allocate dma=%d\n",
2197 driver_name, self->io.dma); 2197 driver_name, self->io.dma);
2198 free_irq(self->io.irq, dev); 2198 free_irq(self->io.irq, dev);
2199 return -EAGAIN; 2199 return -EAGAIN;
2200 } 2200 }
@@ -2372,8 +2372,8 @@ static int nsc_ircc_resume(struct platform_device *dev)
2372 if (netif_running(self->netdev)) { 2372 if (netif_running(self->netdev)) {
2373 if (request_irq(self->io.irq, nsc_ircc_interrupt, 0, 2373 if (request_irq(self->io.irq, nsc_ircc_interrupt, 0,
2374 self->netdev->name, self->netdev)) { 2374 self->netdev->name, self->netdev)) {
2375 IRDA_WARNING("%s, unable to allocate irq=%d\n", 2375 net_warn_ratelimited("%s, unable to allocate irq=%d\n",
2376 driver_name, self->io.irq); 2376 driver_name, self->io.irq);
2377 2377
2378 /* 2378 /*
2379 * Don't fail resume process, just kill this 2379 * Don't fail resume process, just kill this