diff options
author | Joe Perches <joe@perches.com> | 2014-11-11 16:37:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-11 18:11:00 -0500 |
commit | 6c91023dc35c88d5e6aebe4bfe6f1ed5ec2b84be (patch) | |
tree | 2f33e40962dd622ae926ff7e8284f3ef540d3ca9 | |
parent | 09626e9d153326ca82568e4e27f2daa53713992e (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>
42 files changed, 486 insertions, 479 deletions
diff --git a/drivers/net/irda/act200l-sir.c b/drivers/net/irda/act200l-sir.c index 8ff084f1d236..a9116456bc9a 100644 --- a/drivers/net/irda/act200l-sir.c +++ b/drivers/net/irda/act200l-sir.c | |||
@@ -240,7 +240,8 @@ static int act200l_reset(struct sir_dev *dev) | |||
240 | dev->speed = 9600; | 240 | dev->speed = 9600; |
241 | break; | 241 | break; |
242 | default: | 242 | default: |
243 | IRDA_ERROR("%s(), unknown state %d\n", __func__, state); | 243 | net_err_ratelimited("%s(), unknown state %d\n", |
244 | __func__, state); | ||
244 | ret = -1; | 245 | ret = -1; |
245 | break; | 246 | break; |
246 | } | 247 | } |
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c index befa45f809c3..7f23e5ff099e 100644 --- a/drivers/net/irda/ali-ircc.c +++ b/drivers/net/irda/ali-ircc.c | |||
@@ -158,8 +158,8 @@ static int __init ali_ircc_init(void) | |||
158 | 158 | ||
159 | ret = platform_driver_register(&ali_ircc_driver); | 159 | ret = platform_driver_register(&ali_ircc_driver); |
160 | if (ret) { | 160 | if (ret) { |
161 | IRDA_ERROR("%s, Can't register driver!\n", | 161 | net_err_ratelimited("%s, Can't register driver!\n", |
162 | ALI_IRCC_DRIVER_NAME); | 162 | ALI_IRCC_DRIVER_NAME); |
163 | return ret; | 163 | return ret; |
164 | } | 164 | } |
165 | 165 | ||
@@ -292,8 +292,8 @@ static int ali_ircc_open(int i, chipio_t *info) | |||
292 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); | 292 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
293 | 293 | ||
294 | if (i >= ARRAY_SIZE(dev_self)) { | 294 | if (i >= ARRAY_SIZE(dev_self)) { |
295 | IRDA_ERROR("%s(), maximum number of supported chips reached!\n", | 295 | net_err_ratelimited("%s(), maximum number of supported chips reached!\n", |
296 | __func__); | 296 | __func__); |
297 | return -ENOMEM; | 297 | return -ENOMEM; |
298 | } | 298 | } |
299 | 299 | ||
@@ -303,8 +303,8 @@ static int ali_ircc_open(int i, chipio_t *info) | |||
303 | 303 | ||
304 | dev = alloc_irdadev(sizeof(*self)); | 304 | dev = alloc_irdadev(sizeof(*self)); |
305 | if (dev == NULL) { | 305 | if (dev == NULL) { |
306 | IRDA_ERROR("%s(), can't allocate memory for control block!\n", | 306 | net_err_ratelimited("%s(), can't allocate memory for control block!\n", |
307 | __func__); | 307 | __func__); |
308 | return -ENOMEM; | 308 | return -ENOMEM; |
309 | } | 309 | } |
310 | 310 | ||
@@ -328,8 +328,8 @@ static int ali_ircc_open(int i, chipio_t *info) | |||
328 | /* Reserve the ioports that we need */ | 328 | /* Reserve the ioports that we need */ |
329 | if (!request_region(self->io.fir_base, self->io.fir_ext, | 329 | if (!request_region(self->io.fir_base, self->io.fir_ext, |
330 | ALI_IRCC_DRIVER_NAME)) { | 330 | ALI_IRCC_DRIVER_NAME)) { |
331 | IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", __func__, | 331 | net_warn_ratelimited("%s(), can't get iobase of 0x%03x\n", |
332 | self->io.fir_base); | 332 | __func__, self->io.fir_base); |
333 | err = -ENODEV; | 333 | err = -ENODEV; |
334 | goto err_out1; | 334 | goto err_out1; |
335 | } | 335 | } |
@@ -380,15 +380,17 @@ static int ali_ircc_open(int i, chipio_t *info) | |||
380 | 380 | ||
381 | err = register_netdev(dev); | 381 | err = register_netdev(dev); |
382 | if (err) { | 382 | if (err) { |
383 | IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); | 383 | net_err_ratelimited("%s(), register_netdev() failed!\n", |
384 | __func__); | ||
384 | goto err_out4; | 385 | goto err_out4; |
385 | } | 386 | } |
386 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); | 387 | net_info_ratelimited("IrDA: Registered device %s\n", dev->name); |
387 | 388 | ||
388 | /* Check dongle id */ | 389 | /* Check dongle id */ |
389 | dongle_id = ali_ircc_read_dongle_id(i, info); | 390 | dongle_id = ali_ircc_read_dongle_id(i, info); |
390 | IRDA_MESSAGE("%s(), %s, Found dongle: %s\n", __func__, | 391 | net_info_ratelimited("%s(), %s, Found dongle: %s\n", |
391 | ALI_IRCC_DRIVER_NAME, dongle_types[dongle_id]); | 392 | __func__, ALI_IRCC_DRIVER_NAME, |
393 | dongle_types[dongle_id]); | ||
392 | 394 | ||
393 | self->io.dongle_id = dongle_id; | 395 | self->io.dongle_id = dongle_id; |
394 | 396 | ||
@@ -521,7 +523,8 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info) | |||
521 | info->dma = reg & 0x07; | 523 | info->dma = reg & 0x07; |
522 | 524 | ||
523 | if(info->dma == 0x04) | 525 | if(info->dma == 0x04) |
524 | IRDA_WARNING("%s(), No DMA channel assigned !\n", __func__); | 526 | net_warn_ratelimited("%s(), No DMA channel assigned !\n", |
527 | __func__); | ||
525 | else | 528 | else |
526 | IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma); | 529 | IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma); |
527 | 530 | ||
@@ -578,8 +581,8 @@ static int ali_ircc_setup(chipio_t *info) | |||
578 | /* Should be 0x00 in the M1535/M1535D */ | 581 | /* Should be 0x00 in the M1535/M1535D */ |
579 | if(version != 0x00) | 582 | if(version != 0x00) |
580 | { | 583 | { |
581 | IRDA_ERROR("%s, Wrong chip version %02x\n", | 584 | net_err_ratelimited("%s, Wrong chip version %02x\n", |
582 | ALI_IRCC_DRIVER_NAME, version); | 585 | ALI_IRCC_DRIVER_NAME, version); |
583 | return -1; | 586 | return -1; |
584 | } | 587 | } |
585 | 588 | ||
@@ -612,8 +615,8 @@ static int ali_ircc_setup(chipio_t *info) | |||
612 | /* Switch to SIR space */ | 615 | /* Switch to SIR space */ |
613 | FIR2SIR(iobase); | 616 | FIR2SIR(iobase); |
614 | 617 | ||
615 | IRDA_MESSAGE("%s, driver loaded (Benjamin Kong)\n", | 618 | net_info_ratelimited("%s, driver loaded (Benjamin Kong)\n", |
616 | ALI_IRCC_DRIVER_NAME); | 619 | ALI_IRCC_DRIVER_NAME); |
617 | 620 | ||
618 | /* Enable receive interrupts */ | 621 | /* Enable receive interrupts */ |
619 | // outb(UART_IER_RDI, iobase+UART_IER); //benjamin 2000/11/23 01:25PM | 622 | // outb(UART_IER_RDI, iobase+UART_IER); //benjamin 2000/11/23 01:25PM |
@@ -1352,9 +1355,8 @@ static int ali_ircc_net_open(struct net_device *dev) | |||
1352 | /* Request IRQ and install Interrupt Handler */ | 1355 | /* Request IRQ and install Interrupt Handler */ |
1353 | if (request_irq(self->io.irq, ali_ircc_interrupt, 0, dev->name, dev)) | 1356 | if (request_irq(self->io.irq, ali_ircc_interrupt, 0, dev->name, dev)) |
1354 | { | 1357 | { |
1355 | IRDA_WARNING("%s, unable to allocate irq=%d\n", | 1358 | net_warn_ratelimited("%s, unable to allocate irq=%d\n", |
1356 | ALI_IRCC_DRIVER_NAME, | 1359 | ALI_IRCC_DRIVER_NAME, self->io.irq); |
1357 | self->io.irq); | ||
1358 | return -EAGAIN; | 1360 | return -EAGAIN; |
1359 | } | 1361 | } |
1360 | 1362 | ||
@@ -1363,9 +1365,8 @@ static int ali_ircc_net_open(struct net_device *dev) | |||
1363 | * failure. | 1365 | * failure. |
1364 | */ | 1366 | */ |
1365 | if (request_dma(self->io.dma, dev->name)) { | 1367 | if (request_dma(self->io.dma, dev->name)) { |
1366 | IRDA_WARNING("%s, unable to allocate dma=%d\n", | 1368 | net_warn_ratelimited("%s, unable to allocate dma=%d\n", |
1367 | ALI_IRCC_DRIVER_NAME, | 1369 | ALI_IRCC_DRIVER_NAME, self->io.dma); |
1368 | self->io.dma); | ||
1369 | free_irq(self->io.irq, dev); | 1370 | free_irq(self->io.irq, dev); |
1370 | return -EAGAIN; | 1371 | return -EAGAIN; |
1371 | } | 1372 | } |
@@ -1671,7 +1672,8 @@ static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self) | |||
1671 | if((inb(iobase+FIR_LSR) & LSR_FRAME_ABORT) == LSR_FRAME_ABORT) | 1672 | if((inb(iobase+FIR_LSR) & LSR_FRAME_ABORT) == LSR_FRAME_ABORT) |
1672 | 1673 | ||
1673 | { | 1674 | { |
1674 | IRDA_ERROR("%s(), ********* LSR_FRAME_ABORT *********\n", __func__); | 1675 | net_err_ratelimited("%s(), ********* LSR_FRAME_ABORT *********\n", |
1676 | __func__); | ||
1675 | self->netdev->stats.tx_errors++; | 1677 | self->netdev->stats.tx_errors++; |
1676 | self->netdev->stats.tx_fifo_errors++; | 1678 | self->netdev->stats.tx_fifo_errors++; |
1677 | } | 1679 | } |
@@ -1918,9 +1920,6 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1918 | skb = dev_alloc_skb(len+1); | 1920 | skb = dev_alloc_skb(len+1); |
1919 | if (skb == NULL) | 1921 | if (skb == NULL) |
1920 | { | 1922 | { |
1921 | IRDA_WARNING("%s(), memory squeeze, " | ||
1922 | "dropping frame.\n", | ||
1923 | __func__); | ||
1924 | self->netdev->stats.rx_dropped++; | 1923 | self->netdev->stats.rx_dropped++; |
1925 | 1924 | ||
1926 | return FALSE; | 1925 | return FALSE; |
@@ -2127,7 +2126,7 @@ static int ali_ircc_suspend(struct platform_device *dev, pm_message_t state) | |||
2127 | { | 2126 | { |
2128 | struct ali_ircc_cb *self = platform_get_drvdata(dev); | 2127 | struct ali_ircc_cb *self = platform_get_drvdata(dev); |
2129 | 2128 | ||
2130 | IRDA_MESSAGE("%s, Suspending\n", ALI_IRCC_DRIVER_NAME); | 2129 | net_info_ratelimited("%s, Suspending\n", ALI_IRCC_DRIVER_NAME); |
2131 | 2130 | ||
2132 | if (self->io.suspended) | 2131 | if (self->io.suspended) |
2133 | return 0; | 2132 | return 0; |
@@ -2148,7 +2147,7 @@ static int ali_ircc_resume(struct platform_device *dev) | |||
2148 | 2147 | ||
2149 | ali_ircc_net_open(self->netdev); | 2148 | ali_ircc_net_open(self->netdev); |
2150 | 2149 | ||
2151 | IRDA_MESSAGE("%s, Waking up\n", ALI_IRCC_DRIVER_NAME); | 2150 | net_info_ratelimited("%s, Waking up\n", ALI_IRCC_DRIVER_NAME); |
2152 | 2151 | ||
2153 | self->io.suspended = 0; | 2152 | self->io.suspended = 0; |
2154 | 2153 | ||
diff --git a/drivers/net/irda/girbil-sir.c b/drivers/net/irda/girbil-sir.c index 96cdecff349d..f0512ad7dae7 100644 --- a/drivers/net/irda/girbil-sir.c +++ b/drivers/net/irda/girbil-sir.c | |||
@@ -179,7 +179,8 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed) | |||
179 | break; | 179 | break; |
180 | 180 | ||
181 | default: | 181 | default: |
182 | IRDA_ERROR("%s - undefined state %d\n", __func__, state); | 182 | net_err_ratelimited("%s - undefined state %d\n", |
183 | __func__, state); | ||
183 | ret = -EINVAL; | 184 | ret = -EINVAL; |
184 | break; | 185 | break; |
185 | } | 186 | } |
@@ -241,7 +242,8 @@ static int girbil_reset(struct sir_dev *dev) | |||
241 | break; | 242 | break; |
242 | 243 | ||
243 | default: | 244 | default: |
244 | IRDA_ERROR("%s(), undefined state %d\n", __func__, state); | 245 | net_err_ratelimited("%s(), undefined state %d\n", |
246 | __func__, state); | ||
245 | ret = -1; | 247 | ret = -1; |
246 | break; | 248 | break; |
247 | } | 249 | } |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 925b78cc9797..e9aedbe3fc92 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -307,7 +307,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self) | |||
307 | /* Grab the speed URB */ | 307 | /* Grab the speed URB */ |
308 | urb = self->speed_urb; | 308 | urb = self->speed_urb; |
309 | if (urb->status != 0) { | 309 | if (urb->status != 0) { |
310 | IRDA_WARNING("%s(), URB still in use!\n", __func__); | 310 | net_warn_ratelimited("%s(), URB still in use!\n", __func__); |
311 | return; | 311 | return; |
312 | } | 312 | } |
313 | 313 | ||
@@ -333,7 +333,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self) | |||
333 | 333 | ||
334 | /* Irq disabled -> GFP_ATOMIC */ | 334 | /* Irq disabled -> GFP_ATOMIC */ |
335 | if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) { | 335 | if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) { |
336 | IRDA_WARNING("%s(), failed Speed URB\n", __func__); | 336 | net_warn_ratelimited("%s(), failed Speed URB\n", __func__); |
337 | } | 337 | } |
338 | } | 338 | } |
339 | 339 | ||
@@ -435,7 +435,7 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb, | |||
435 | } | 435 | } |
436 | 436 | ||
437 | if (urb->status != 0) { | 437 | if (urb->status != 0) { |
438 | IRDA_WARNING("%s(), URB still in use!\n", __func__); | 438 | net_warn_ratelimited("%s(), URB still in use!\n", __func__); |
439 | goto drop; | 439 | goto drop; |
440 | } | 440 | } |
441 | 441 | ||
@@ -522,7 +522,7 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb, | |||
522 | 522 | ||
523 | /* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */ | 523 | /* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */ |
524 | if ((res = usb_submit_urb(urb, GFP_ATOMIC))) { | 524 | if ((res = usb_submit_urb(urb, GFP_ATOMIC))) { |
525 | IRDA_WARNING("%s(), failed Tx URB\n", __func__); | 525 | net_warn_ratelimited("%s(), failed Tx URB\n", __func__); |
526 | netdev->stats.tx_errors++; | 526 | netdev->stats.tx_errors++; |
527 | /* Let USB recover : We will catch that in the watchdog */ | 527 | /* Let USB recover : We will catch that in the watchdog */ |
528 | /*netif_start_queue(netdev);*/ | 528 | /*netif_start_queue(netdev);*/ |
@@ -638,7 +638,7 @@ static void irda_usb_net_timeout(struct net_device *netdev) | |||
638 | 638 | ||
639 | /* self->present *MUST* be read under spinlock */ | 639 | /* self->present *MUST* be read under spinlock */ |
640 | if (!self->present) { | 640 | if (!self->present) { |
641 | IRDA_WARNING("%s(), device not present!\n", __func__); | 641 | net_warn_ratelimited("%s(), device not present!\n", __func__); |
642 | netif_stop_queue(netdev); | 642 | netif_stop_queue(netdev); |
643 | spin_unlock_irqrestore(&self->lock, flags); | 643 | spin_unlock_irqrestore(&self->lock, flags); |
644 | return; | 644 | return; |
@@ -783,8 +783,8 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc | |||
783 | if (ret) { | 783 | if (ret) { |
784 | /* If this ever happen, we are in deep s***. | 784 | /* If this ever happen, we are in deep s***. |
785 | * Basically, the Rx path will stop... */ | 785 | * Basically, the Rx path will stop... */ |
786 | IRDA_WARNING("%s(), Failed to submit Rx URB %d\n", | 786 | net_warn_ratelimited("%s(), Failed to submit Rx URB %d\n", |
787 | __func__, ret); | 787 | __func__, ret); |
788 | } | 788 | } |
789 | } | 789 | } |
790 | 790 | ||
@@ -859,7 +859,7 @@ static void irda_usb_receive(struct urb *urb) | |||
859 | 859 | ||
860 | /* Check for empty frames */ | 860 | /* Check for empty frames */ |
861 | if (urb->actual_length <= self->header_length) { | 861 | if (urb->actual_length <= self->header_length) { |
862 | IRDA_WARNING("%s(), empty frame!\n", __func__); | 862 | net_warn_ratelimited("%s(), empty frame!\n", __func__); |
863 | goto done; | 863 | goto done; |
864 | } | 864 | } |
865 | 865 | ||
@@ -1088,8 +1088,8 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1088 | return ret; | 1088 | return ret; |
1089 | 1089 | ||
1090 | /* We get a patch from userspace */ | 1090 | /* We get a patch from userspace */ |
1091 | IRDA_MESSAGE("%s(): Received firmware %s (%zu bytes)\n", | 1091 | net_info_ratelimited("%s(): Received firmware %s (%zu bytes)\n", |
1092 | __func__, stir421x_fw_name, fw->size); | 1092 | __func__, stir421x_fw_name, fw->size); |
1093 | 1093 | ||
1094 | ret = -EINVAL; | 1094 | ret = -EINVAL; |
1095 | 1095 | ||
@@ -1179,13 +1179,13 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1179 | /* Can only open the device if it's there */ | 1179 | /* Can only open the device if it's there */ |
1180 | if(!self->present) { | 1180 | if(!self->present) { |
1181 | spin_unlock_irqrestore(&self->lock, flags); | 1181 | spin_unlock_irqrestore(&self->lock, flags); |
1182 | IRDA_WARNING("%s(), device not present!\n", __func__); | 1182 | net_warn_ratelimited("%s(), device not present!\n", __func__); |
1183 | return -1; | 1183 | return -1; |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | if(self->needspatch) { | 1186 | if(self->needspatch) { |
1187 | spin_unlock_irqrestore(&self->lock, flags); | 1187 | spin_unlock_irqrestore(&self->lock, flags); |
1188 | IRDA_WARNING("%s(), device needs patch\n", __func__) ; | 1188 | net_warn_ratelimited("%s(), device needs patch\n", __func__); |
1189 | return -EIO ; | 1189 | return -EIO ; |
1190 | } | 1190 | } |
1191 | 1191 | ||
@@ -1227,8 +1227,6 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1227 | if (!skb) { | 1227 | if (!skb) { |
1228 | /* If this ever happen, we are in deep s***. | 1228 | /* If this ever happen, we are in deep s***. |
1229 | * Basically, we can't start the Rx path... */ | 1229 | * Basically, we can't start the Rx path... */ |
1230 | IRDA_WARNING("%s(), Failed to allocate Rx skb\n", | ||
1231 | __func__); | ||
1232 | return -1; | 1230 | return -1; |
1233 | } | 1231 | } |
1234 | //skb_reserve(newskb, USB_IRDA_HEADER - 1); | 1232 | //skb_reserve(newskb, USB_IRDA_HEADER - 1); |
@@ -1505,7 +1503,8 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_ | |||
1505 | /* This is our interrupt endpoint */ | 1503 | /* This is our interrupt endpoint */ |
1506 | self->bulk_int_ep = ep; | 1504 | self->bulk_int_ep = ep; |
1507 | } else { | 1505 | } else { |
1508 | IRDA_ERROR("%s(), Unrecognised endpoint %02X.\n", __func__, ep); | 1506 | net_err_ratelimited("%s(), Unrecognised endpoint %02X\n", |
1507 | __func__, ep); | ||
1509 | } | 1508 | } |
1510 | } | 1509 | } |
1511 | } | 1510 | } |
@@ -1575,11 +1574,11 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf | |||
1575 | 1574 | ||
1576 | IRDA_DEBUG(1, "%s(), ret=%d\n", __func__, ret); | 1575 | IRDA_DEBUG(1, "%s(), ret=%d\n", __func__, ret); |
1577 | if (ret < sizeof(*desc)) { | 1576 | if (ret < sizeof(*desc)) { |
1578 | IRDA_WARNING("usb-irda: class_descriptor read %s (%d)\n", | 1577 | net_warn_ratelimited("usb-irda: class_descriptor read %s (%d)\n", |
1579 | (ret<0) ? "failed" : "too short", ret); | 1578 | ret < 0 ? "failed" : "too short", ret); |
1580 | } | 1579 | } |
1581 | else if (desc->bDescriptorType != USB_DT_IRDA) { | 1580 | else if (desc->bDescriptorType != USB_DT_IRDA) { |
1582 | IRDA_WARNING("usb-irda: bad class_descriptor type\n"); | 1581 | net_warn_ratelimited("usb-irda: bad class_descriptor type\n"); |
1583 | } | 1582 | } |
1584 | else { | 1583 | else { |
1585 | #ifdef IU_DUMP_CLASS_DESC | 1584 | #ifdef IU_DUMP_CLASS_DESC |
@@ -1622,9 +1621,9 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1622 | * don't need to check if the dongle is really ours. | 1621 | * don't need to check if the dongle is really ours. |
1623 | * Jean II */ | 1622 | * Jean II */ |
1624 | 1623 | ||
1625 | IRDA_MESSAGE("IRDA-USB found at address %d, Vendor: %x, Product: %x\n", | 1624 | net_info_ratelimited("IRDA-USB found at address %d, Vendor: %x, Product: %x\n", |
1626 | dev->devnum, le16_to_cpu(dev->descriptor.idVendor), | 1625 | dev->devnum, le16_to_cpu(dev->descriptor.idVendor), |
1627 | le16_to_cpu(dev->descriptor.idProduct)); | 1626 | le16_to_cpu(dev->descriptor.idProduct)); |
1628 | 1627 | ||
1629 | net = alloc_irdadev(sizeof(*self)); | 1628 | net = alloc_irdadev(sizeof(*self)); |
1630 | if (!net) | 1629 | if (!net) |
@@ -1700,7 +1699,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1700 | interface = intf->cur_altsetting; | 1699 | interface = intf->cur_altsetting; |
1701 | if(!irda_usb_parse_endpoints(self, interface->endpoint, | 1700 | if(!irda_usb_parse_endpoints(self, interface->endpoint, |
1702 | interface->desc.bNumEndpoints)) { | 1701 | interface->desc.bNumEndpoints)) { |
1703 | IRDA_ERROR("%s(), Bogus endpoints...\n", __func__); | 1702 | net_err_ratelimited("%s(), Bogus endpoints...\n", __func__); |
1704 | ret = -EIO; | 1703 | ret = -EIO; |
1705 | goto err_out_3; | 1704 | goto err_out_3; |
1706 | } | 1705 | } |
@@ -1746,7 +1745,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1746 | if (ret) | 1745 | if (ret) |
1747 | goto err_out_5; | 1746 | goto err_out_5; |
1748 | 1747 | ||
1749 | IRDA_MESSAGE("IrDA: Registered device %s\n", net->name); | 1748 | net_info_ratelimited("IrDA: Registered device %s\n", net->name); |
1750 | usb_set_intfdata(intf, self); | 1749 | usb_set_intfdata(intf, self); |
1751 | 1750 | ||
1752 | if (self->needspatch) { | 1751 | if (self->needspatch) { |
@@ -1754,7 +1753,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1754 | ret = stir421x_patch_device(self); | 1753 | ret = stir421x_patch_device(self); |
1755 | self->needspatch = (ret < 0); | 1754 | self->needspatch = (ret < 0); |
1756 | if (self->needspatch) { | 1755 | if (self->needspatch) { |
1757 | IRDA_ERROR("STIR421X: Couldn't upload patch\n"); | 1756 | net_err_ratelimited("STIR421X: Couldn't upload patch\n"); |
1758 | goto err_out_6; | 1757 | goto err_out_6; |
1759 | } | 1758 | } |
1760 | 1759 | ||
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index 24b6dddd7f2f..abbb654c0666 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c | |||
@@ -231,7 +231,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
231 | 231 | ||
232 | dev = priv->dev; | 232 | dev = priv->dev; |
233 | if (!dev) { | 233 | if (!dev) { |
234 | IRDA_WARNING("%s(), not ready yet!\n", __func__); | 234 | net_warn_ratelimited("%s(), not ready yet!\n", __func__); |
235 | return; | 235 | return; |
236 | } | 236 | } |
237 | 237 | ||
@@ -555,8 +555,8 @@ static int __init irtty_sir_init(void) | |||
555 | int err; | 555 | int err; |
556 | 556 | ||
557 | if ((err = tty_register_ldisc(N_IRDA, &irda_ldisc)) != 0) | 557 | if ((err = tty_register_ldisc(N_IRDA, &irda_ldisc)) != 0) |
558 | IRDA_ERROR("IrDA: can't register line discipline (err = %d)\n", | 558 | net_err_ratelimited("IrDA: can't register line discipline (err = %d)\n", |
559 | err); | 559 | err); |
560 | return err; | 560 | return err; |
561 | } | 561 | } |
562 | 562 | ||
@@ -565,8 +565,8 @@ static void __exit irtty_sir_cleanup(void) | |||
565 | int err; | 565 | int err; |
566 | 566 | ||
567 | if ((err = tty_unregister_ldisc(N_IRDA))) { | 567 | if ((err = tty_unregister_ldisc(N_IRDA))) { |
568 | IRDA_ERROR("%s(), can't unregister line discipline (err = %d)\n", | 568 | net_err_ratelimited("%s(), can't unregister line discipline (err = %d)\n", |
569 | __func__, err); | 569 | __func__, err); |
570 | } | 570 | } |
571 | } | 571 | } |
572 | 572 | ||
diff --git a/drivers/net/irda/ma600-sir.c b/drivers/net/irda/ma600-sir.c index a9a81358477b..944d044510e3 100644 --- a/drivers/net/irda/ma600-sir.c +++ b/drivers/net/irda/ma600-sir.c | |||
@@ -198,9 +198,9 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed) | |||
198 | 198 | ||
199 | sirdev_raw_read(dev, &byte, sizeof(byte)); | 199 | sirdev_raw_read(dev, &byte, sizeof(byte)); |
200 | if (byte != get_control_byte(speed)) { | 200 | if (byte != get_control_byte(speed)) { |
201 | IRDA_WARNING("%s(): bad control byte read-back %02x != %02x\n", | 201 | net_warn_ratelimited("%s(): bad control byte read-back %02x != %02x\n", |
202 | __func__, (unsigned) byte, | 202 | __func__, (unsigned)byte, |
203 | (unsigned) get_control_byte(speed)); | 203 | (unsigned)get_control_byte(speed)); |
204 | return -1; | 204 | return -1; |
205 | } | 205 | } |
206 | else | 206 | else |
diff --git a/drivers/net/irda/mcp2120-sir.c b/drivers/net/irda/mcp2120-sir.c index 5e2f4859cee7..97674695211c 100644 --- a/drivers/net/irda/mcp2120-sir.c +++ b/drivers/net/irda/mcp2120-sir.c | |||
@@ -155,7 +155,8 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed) | |||
155 | break; | 155 | break; |
156 | 156 | ||
157 | default: | 157 | default: |
158 | IRDA_ERROR("%s(), undefine state %d\n", __func__, state); | 158 | net_err_ratelimited("%s(), undefine state %d\n", |
159 | __func__, state); | ||
159 | ret = -EINVAL; | 160 | ret = -EINVAL; |
160 | break; | 161 | break; |
161 | } | 162 | } |
@@ -213,7 +214,8 @@ static int mcp2120_reset(struct sir_dev *dev) | |||
213 | break; | 214 | break; |
214 | 215 | ||
215 | default: | 216 | default: |
216 | IRDA_ERROR("%s(), undefined state %d\n", __func__, state); | 217 | net_err_ratelimited("%s(), undefined state %d\n", |
218 | __func__, state); | ||
217 | ret = -EINVAL; | 219 | ret = -EINVAL; |
218 | break; | 220 | break; |
219 | } | 221 | } |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index 16f8ffb50e04..6cbd29dcf2d6 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -197,14 +197,14 @@ error: | |||
197 | /* Setup a communication between mcs7780 and agilent chip. */ | 197 | /* Setup a communication between mcs7780 and agilent chip. */ |
198 | static inline int mcs_setup_transceiver_agilent(struct mcs_cb *mcs) | 198 | static inline int mcs_setup_transceiver_agilent(struct mcs_cb *mcs) |
199 | { | 199 | { |
200 | IRDA_WARNING("This transceiver type is not supported yet.\n"); | 200 | net_warn_ratelimited("This transceiver type is not supported yet\n"); |
201 | return 1; | 201 | return 1; |
202 | } | 202 | } |
203 | 203 | ||
204 | /* Setup a communication between mcs7780 and sharp chip. */ | 204 | /* Setup a communication between mcs7780 and sharp chip. */ |
205 | static inline int mcs_setup_transceiver_sharp(struct mcs_cb *mcs) | 205 | static inline int mcs_setup_transceiver_sharp(struct mcs_cb *mcs) |
206 | { | 206 | { |
207 | IRDA_WARNING("This transceiver type is not supported yet.\n"); | 207 | net_warn_ratelimited("This transceiver type is not supported yet\n"); |
208 | return 1; | 208 | return 1; |
209 | } | 209 | } |
210 | 210 | ||
@@ -213,9 +213,9 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) | |||
213 | { | 213 | { |
214 | int ret = 0; | 214 | int ret = 0; |
215 | __u16 rval; | 215 | __u16 rval; |
216 | char *msg; | 216 | const char *msg; |
217 | 217 | ||
218 | msg = "Basic transceiver setup error."; | 218 | msg = "Basic transceiver setup error"; |
219 | 219 | ||
220 | /* read value of MODE Register, set the DRIVER and RESET bits | 220 | /* read value of MODE Register, set the DRIVER and RESET bits |
221 | * and write value back out to MODE Register | 221 | * and write value back out to MODE Register |
@@ -261,7 +261,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) | |||
261 | if(unlikely(ret)) | 261 | if(unlikely(ret)) |
262 | goto error; | 262 | goto error; |
263 | 263 | ||
264 | msg = "transceiver model specific setup error."; | 264 | msg = "transceiver model specific setup error"; |
265 | switch (mcs->transceiver_type) { | 265 | switch (mcs->transceiver_type) { |
266 | case MCS_TSC_VISHAY: | 266 | case MCS_TSC_VISHAY: |
267 | ret = mcs_setup_transceiver_vishay(mcs); | 267 | ret = mcs_setup_transceiver_vishay(mcs); |
@@ -276,8 +276,8 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) | |||
276 | break; | 276 | break; |
277 | 277 | ||
278 | default: | 278 | default: |
279 | IRDA_WARNING("Unknown transceiver type: %d\n", | 279 | net_warn_ratelimited("Unknown transceiver type: %d\n", |
280 | mcs->transceiver_type); | 280 | mcs->transceiver_type); |
281 | ret = 1; | 281 | ret = 1; |
282 | } | 282 | } |
283 | if (unlikely(ret)) | 283 | if (unlikely(ret)) |
@@ -300,7 +300,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) | |||
300 | goto error; | 300 | goto error; |
301 | } | 301 | } |
302 | 302 | ||
303 | msg = "transceiver reset."; | 303 | msg = "transceiver reset"; |
304 | 304 | ||
305 | ret = mcs_get_reg(mcs, MCS_MODE_REG, &rval); | 305 | ret = mcs_get_reg(mcs, MCS_MODE_REG, &rval); |
306 | if (unlikely(ret != 2)) | 306 | if (unlikely(ret != 2)) |
@@ -315,7 +315,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs) | |||
315 | return ret; | 315 | return ret; |
316 | 316 | ||
317 | error: | 317 | error: |
318 | IRDA_ERROR("%s\n", msg); | 318 | net_err_ratelimited("%s\n", msg); |
319 | return ret; | 319 | return ret; |
320 | } | 320 | } |
321 | 321 | ||
@@ -399,8 +399,8 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len) | |||
399 | 399 | ||
400 | new_len = len - 2; | 400 | new_len = len - 2; |
401 | if(unlikely(new_len <= 0)) { | 401 | if(unlikely(new_len <= 0)) { |
402 | IRDA_ERROR("%s short frame length %d\n", | 402 | net_err_ratelimited("%s short frame length %d\n", |
403 | mcs->netdev->name, new_len); | 403 | mcs->netdev->name, new_len); |
404 | ++mcs->netdev->stats.rx_errors; | 404 | ++mcs->netdev->stats.rx_errors; |
405 | ++mcs->netdev->stats.rx_length_errors; | 405 | ++mcs->netdev->stats.rx_length_errors; |
406 | return; | 406 | return; |
@@ -409,8 +409,8 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len) | |||
409 | fcs = irda_calc_crc16(~fcs, buf, len); | 409 | fcs = irda_calc_crc16(~fcs, buf, len); |
410 | 410 | ||
411 | if(fcs != GOOD_FCS) { | 411 | if(fcs != GOOD_FCS) { |
412 | IRDA_ERROR("crc error calc 0x%x len %d\n", | 412 | net_err_ratelimited("crc error calc 0x%x len %d\n", |
413 | fcs, new_len); | 413 | fcs, new_len); |
414 | mcs->netdev->stats.rx_errors++; | 414 | mcs->netdev->stats.rx_errors++; |
415 | mcs->netdev->stats.rx_crc_errors++; | 415 | mcs->netdev->stats.rx_crc_errors++; |
416 | return; | 416 | return; |
@@ -452,8 +452,8 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len) | |||
452 | 452 | ||
453 | new_len = len - 4; | 453 | new_len = len - 4; |
454 | if(unlikely(new_len <= 0)) { | 454 | if(unlikely(new_len <= 0)) { |
455 | IRDA_ERROR("%s short frame length %d\n", | 455 | net_err_ratelimited("%s short frame length %d\n", |
456 | mcs->netdev->name, new_len); | 456 | mcs->netdev->name, new_len); |
457 | ++mcs->netdev->stats.rx_errors; | 457 | ++mcs->netdev->stats.rx_errors; |
458 | ++mcs->netdev->stats.rx_length_errors; | 458 | ++mcs->netdev->stats.rx_length_errors; |
459 | return; | 459 | return; |
@@ -461,7 +461,8 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len) | |||
461 | 461 | ||
462 | fcs = ~(crc32_le(~0, buf, new_len)); | 462 | fcs = ~(crc32_le(~0, buf, new_len)); |
463 | if(fcs != get_unaligned_le32(buf + new_len)) { | 463 | if(fcs != get_unaligned_le32(buf + new_len)) { |
464 | IRDA_ERROR("crc error calc 0x%x len %d\n", fcs, new_len); | 464 | net_err_ratelimited("crc error calc 0x%x len %d\n", |
465 | fcs, new_len); | ||
465 | mcs->netdev->stats.rx_errors++; | 466 | mcs->netdev->stats.rx_errors++; |
466 | mcs->netdev->stats.rx_crc_errors++; | 467 | mcs->netdev->stats.rx_crc_errors++; |
467 | return; | 468 | return; |
@@ -583,7 +584,7 @@ static int mcs_speed_change(struct mcs_cb *mcs) | |||
583 | } while(cnt++ < 100 && (rval & MCS_IRINTX)); | 584 | } while(cnt++ < 100 && (rval & MCS_IRINTX)); |
584 | 585 | ||
585 | if (cnt > 100) { | 586 | if (cnt > 100) { |
586 | IRDA_ERROR("unable to change speed\n"); | 587 | net_err_ratelimited("unable to change speed\n"); |
587 | ret = -EIO; | 588 | ret = -EIO; |
588 | goto error; | 589 | goto error; |
589 | } | 590 | } |
@@ -634,8 +635,8 @@ static int mcs_speed_change(struct mcs_cb *mcs) | |||
634 | 635 | ||
635 | default: | 636 | default: |
636 | ret = 1; | 637 | ret = 1; |
637 | IRDA_WARNING("Unknown transceiver type: %d\n", | 638 | net_warn_ratelimited("Unknown transceiver type: %d\n", |
638 | mcs->transceiver_type); | 639 | mcs->transceiver_type); |
639 | } | 640 | } |
640 | if (unlikely(ret)) | 641 | if (unlikely(ret)) |
641 | goto error; | 642 | goto error; |
@@ -731,7 +732,7 @@ static int mcs_net_open(struct net_device *netdev) | |||
731 | sprintf(hwname, "usb#%d", mcs->usbdev->devnum); | 732 | sprintf(hwname, "usb#%d", mcs->usbdev->devnum); |
732 | mcs->irlap = irlap_open(netdev, &mcs->qos, hwname); | 733 | mcs->irlap = irlap_open(netdev, &mcs->qos, hwname); |
733 | if (!mcs->irlap) { | 734 | if (!mcs->irlap) { |
734 | IRDA_ERROR("mcs7780: irlap_open failed\n"); | 735 | net_err_ratelimited("mcs7780: irlap_open failed\n"); |
735 | goto error2; | 736 | goto error2; |
736 | } | 737 | } |
737 | 738 | ||
@@ -851,7 +852,7 @@ static netdev_tx_t mcs_hard_xmit(struct sk_buff *skb, | |||
851 | mcs->out_buf, wraplen, mcs_send_irq, mcs); | 852 | mcs->out_buf, wraplen, mcs_send_irq, mcs); |
852 | 853 | ||
853 | if ((ret = usb_submit_urb(mcs->tx_urb, GFP_ATOMIC))) { | 854 | if ((ret = usb_submit_urb(mcs->tx_urb, GFP_ATOMIC))) { |
854 | IRDA_ERROR("failed tx_urb: %d\n", ret); | 855 | net_err_ratelimited("failed tx_urb: %d\n", ret); |
855 | switch (ret) { | 856 | switch (ret) { |
856 | case -ENODEV: | 857 | case -ENODEV: |
857 | case -EPIPE: | 858 | case -EPIPE: |
@@ -899,7 +900,7 @@ static int mcs_probe(struct usb_interface *intf, | |||
899 | 900 | ||
900 | ret = usb_reset_configuration(udev); | 901 | ret = usb_reset_configuration(udev); |
901 | if (ret != 0) { | 902 | if (ret != 0) { |
902 | IRDA_ERROR("mcs7780: usb reset configuration failed\n"); | 903 | net_err_ratelimited("mcs7780: usb reset configuration failed\n"); |
903 | goto error2; | 904 | goto error2; |
904 | } | 905 | } |
905 | 906 | ||
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 |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index 43e9ab4f4d7e..5bfcd25923b4 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
@@ -82,7 +82,7 @@ static int sirdev_tx_complete_fsm(struct sir_dev *dev) | |||
82 | return 0; | 82 | return 0; |
83 | 83 | ||
84 | default: | 84 | default: |
85 | IRDA_ERROR("%s - undefined state\n", __func__); | 85 | net_err_ratelimited("%s - undefined state\n", __func__); |
86 | return -EINVAL; | 86 | return -EINVAL; |
87 | } | 87 | } |
88 | fsm->substate = next_state; | 88 | fsm->substate = next_state; |
@@ -251,12 +251,13 @@ static void sirdev_config_fsm(struct work_struct *work) | |||
251 | break; | 251 | break; |
252 | 252 | ||
253 | default: | 253 | default: |
254 | IRDA_ERROR("%s - undefined state\n", __func__); | 254 | net_err_ratelimited("%s - undefined state\n", __func__); |
255 | fsm->result = -EINVAL; | 255 | fsm->result = -EINVAL; |
256 | /* fall thru */ | 256 | /* fall thru */ |
257 | 257 | ||
258 | case SIRDEV_STATE_ERROR: | 258 | case SIRDEV_STATE_ERROR: |
259 | IRDA_ERROR("%s - error: %d\n", __func__, fsm->result); | 259 | net_err_ratelimited("%s - error: %d\n", |
260 | __func__, fsm->result); | ||
260 | 261 | ||
261 | #if 0 /* don't enable this before we have netdev->tx_timeout to recover */ | 262 | #if 0 /* don't enable this before we have netdev->tx_timeout to recover */ |
262 | netif_stop_queue(dev->netdev); | 263 | netif_stop_queue(dev->netdev); |
@@ -299,7 +300,7 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par | |||
299 | 300 | ||
300 | if (fsm->state == SIRDEV_STATE_DEAD) { | 301 | if (fsm->state == SIRDEV_STATE_DEAD) { |
301 | /* race with sirdev_close should never happen */ | 302 | /* race with sirdev_close should never happen */ |
302 | IRDA_ERROR("%s(), instance staled!\n", __func__); | 303 | net_err_ratelimited("%s(), instance staled!\n", __func__); |
303 | up(&fsm->sem); | 304 | up(&fsm->sem); |
304 | return -ESTALE; /* or better EPIPE? */ | 305 | return -ESTALE; /* or better EPIPE? */ |
305 | } | 306 | } |
@@ -452,8 +453,8 @@ void sirdev_write_complete(struct sir_dev *dev) | |||
452 | } | 453 | } |
453 | else if (unlikely(actual<0)) { | 454 | else if (unlikely(actual<0)) { |
454 | /* could be dropped later when we have tx_timeout to recover */ | 455 | /* could be dropped later when we have tx_timeout to recover */ |
455 | IRDA_ERROR("%s: drv->do_write failed (%d)\n", | 456 | net_err_ratelimited("%s: drv->do_write failed (%d)\n", |
456 | __func__, actual); | 457 | __func__, actual); |
457 | if ((skb=dev->tx_skb) != NULL) { | 458 | if ((skb=dev->tx_skb) != NULL) { |
458 | dev->tx_skb = NULL; | 459 | dev->tx_skb = NULL; |
459 | dev_kfree_skb_any(skb); | 460 | dev_kfree_skb_any(skb); |
@@ -507,8 +508,8 @@ void sirdev_write_complete(struct sir_dev *dev) | |||
507 | /* should never happen | 508 | /* should never happen |
508 | * forget the speed change and hope the stack recovers | 509 | * forget the speed change and hope the stack recovers |
509 | */ | 510 | */ |
510 | IRDA_ERROR("%s - schedule speed change failed: %d\n", | 511 | net_err_ratelimited("%s - schedule speed change failed: %d\n", |
511 | __func__, err); | 512 | __func__, err); |
512 | netif_wake_queue(dev->netdev); | 513 | netif_wake_queue(dev->netdev); |
513 | } | 514 | } |
514 | /* else: success | 515 | /* else: success |
@@ -535,13 +536,13 @@ EXPORT_SYMBOL(sirdev_write_complete); | |||
535 | int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count) | 536 | int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count) |
536 | { | 537 | { |
537 | if (!dev || !dev->netdev) { | 538 | if (!dev || !dev->netdev) { |
538 | IRDA_WARNING("%s(), not ready yet!\n", __func__); | 539 | net_warn_ratelimited("%s(), not ready yet!\n", __func__); |
539 | return -1; | 540 | return -1; |
540 | } | 541 | } |
541 | 542 | ||
542 | if (!dev->irlap) { | 543 | if (!dev->irlap) { |
543 | IRDA_WARNING("%s - too early: %p / %zd!\n", | 544 | net_warn_ratelimited("%s - too early: %p / %zd!\n", |
544 | __func__, cp, count); | 545 | __func__, cp, count); |
545 | return -1; | 546 | return -1; |
546 | } | 547 | } |
547 | 548 | ||
@@ -661,8 +662,8 @@ static netdev_tx_t sirdev_hard_xmit(struct sk_buff *skb, | |||
661 | } | 662 | } |
662 | else if (unlikely(actual < 0)) { | 663 | else if (unlikely(actual < 0)) { |
663 | /* could be dropped later when we have tx_timeout to recover */ | 664 | /* could be dropped later when we have tx_timeout to recover */ |
664 | IRDA_ERROR("%s: drv->do_write failed (%d)\n", | 665 | net_err_ratelimited("%s: drv->do_write failed (%d)\n", |
665 | __func__, actual); | 666 | __func__, actual); |
666 | dev_kfree_skb_any(skb); | 667 | dev_kfree_skb_any(skb); |
667 | dev->netdev->stats.tx_errors++; | 668 | dev->netdev->stats.tx_errors++; |
668 | dev->netdev->stats.tx_dropped++; | 669 | dev->netdev->stats.tx_dropped++; |
@@ -894,7 +895,8 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n | |||
894 | */ | 895 | */ |
895 | ndev = alloc_irdadev(sizeof(*dev)); | 896 | ndev = alloc_irdadev(sizeof(*dev)); |
896 | if (ndev == NULL) { | 897 | if (ndev == NULL) { |
897 | IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __func__); | 898 | net_err_ratelimited("%s - Can't allocate memory for IrDA control block!\n", |
899 | __func__); | ||
898 | goto out; | 900 | goto out; |
899 | } | 901 | } |
900 | dev = netdev_priv(ndev); | 902 | dev = netdev_priv(ndev); |
@@ -919,7 +921,8 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n | |||
919 | ndev->netdev_ops = &sirdev_ops; | 921 | ndev->netdev_ops = &sirdev_ops; |
920 | 922 | ||
921 | if (register_netdev(ndev)) { | 923 | if (register_netdev(ndev)) { |
922 | IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); | 924 | net_err_ratelimited("%s(), register_netdev() failed!\n", |
925 | __func__); | ||
923 | goto out_freenetdev; | 926 | goto out_freenetdev; |
924 | } | 927 | } |
925 | 928 | ||
@@ -946,7 +949,7 @@ int sirdev_put_instance(struct sir_dev *dev) | |||
946 | if (dev->dongle_drv) | 949 | if (dev->dongle_drv) |
947 | err = sirdev_schedule_dongle_close(dev); | 950 | err = sirdev_schedule_dongle_close(dev); |
948 | if (err) | 951 | if (err) |
949 | IRDA_ERROR("%s - error %d\n", __func__, err); | 952 | net_err_ratelimited("%s - error %d\n", __func__, err); |
950 | 953 | ||
951 | sirdev_close(dev->netdev); | 954 | sirdev_close(dev->netdev); |
952 | 955 | ||
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 282120430f12..a7f0f5214ad7 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -419,13 +419,16 @@ static int __init smsc_ircc_legacy_probe(void) | |||
419 | #ifdef CONFIG_PCI | 419 | #ifdef CONFIG_PCI |
420 | if (smsc_ircc_preconfigure_subsystems(ircc_cfg, ircc_fir, ircc_sir, ircc_dma, ircc_irq) < 0) { | 420 | if (smsc_ircc_preconfigure_subsystems(ircc_cfg, ircc_fir, ircc_sir, ircc_dma, ircc_irq) < 0) { |
421 | /* Ignore errors from preconfiguration */ | 421 | /* Ignore errors from preconfiguration */ |
422 | IRDA_ERROR("%s, Preconfiguration failed !\n", driver_name); | 422 | net_err_ratelimited("%s, Preconfiguration failed !\n", |
423 | driver_name); | ||
423 | } | 424 | } |
424 | #endif | 425 | #endif |
425 | 426 | ||
426 | if (ircc_fir > 0 && ircc_sir > 0) { | 427 | if (ircc_fir > 0 && ircc_sir > 0) { |
427 | IRDA_MESSAGE(" Overriding FIR address 0x%04x\n", ircc_fir); | 428 | net_info_ratelimited(" Overriding FIR address 0x%04x\n", |
428 | IRDA_MESSAGE(" Overriding SIR address 0x%04x\n", ircc_sir); | 429 | ircc_fir); |
430 | net_info_ratelimited(" Overriding SIR address 0x%04x\n", | ||
431 | ircc_sir); | ||
429 | 432 | ||
430 | if (smsc_ircc_open(ircc_fir, ircc_sir, ircc_dma, ircc_irq)) | 433 | if (smsc_ircc_open(ircc_fir, ircc_sir, ircc_dma, ircc_irq)) |
431 | ret = -ENODEV; | 434 | ret = -ENODEV; |
@@ -434,8 +437,8 @@ static int __init smsc_ircc_legacy_probe(void) | |||
434 | 437 | ||
435 | /* try user provided configuration register base address */ | 438 | /* try user provided configuration register base address */ |
436 | if (ircc_cfg > 0) { | 439 | if (ircc_cfg > 0) { |
437 | IRDA_MESSAGE(" Overriding configuration address " | 440 | net_info_ratelimited(" Overriding configuration address 0x%04x\n", |
438 | "0x%04x\n", ircc_cfg); | 441 | ircc_cfg); |
439 | if (!smsc_superio_fdc(ircc_cfg)) | 442 | if (!smsc_superio_fdc(ircc_cfg)) |
440 | ret = 0; | 443 | ret = 0; |
441 | if (!smsc_superio_lpc(ircc_cfg)) | 444 | if (!smsc_superio_lpc(ircc_cfg)) |
@@ -462,7 +465,8 @@ static int __init smsc_ircc_init(void) | |||
462 | 465 | ||
463 | ret = platform_driver_register(&smsc_ircc_driver); | 466 | ret = platform_driver_register(&smsc_ircc_driver); |
464 | if (ret) { | 467 | if (ret) { |
465 | IRDA_ERROR("%s, Can't register driver!\n", driver_name); | 468 | net_err_ratelimited("%s, Can't register driver!\n", |
469 | driver_name); | ||
466 | return ret; | 470 | return ret; |
467 | } | 471 | } |
468 | 472 | ||
@@ -527,7 +531,7 @@ static int smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, | |||
527 | 531 | ||
528 | err = -ENOMEM; | 532 | err = -ENOMEM; |
529 | if (dev_count >= ARRAY_SIZE(dev_self)) { | 533 | if (dev_count >= ARRAY_SIZE(dev_self)) { |
530 | IRDA_WARNING("%s(), too many devices!\n", __func__); | 534 | net_warn_ratelimited("%s(), too many devices!\n", __func__); |
531 | goto err_out1; | 535 | goto err_out1; |
532 | } | 536 | } |
533 | 537 | ||
@@ -536,7 +540,8 @@ static int smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, | |||
536 | */ | 540 | */ |
537 | dev = alloc_irdadev(sizeof(struct smsc_ircc_cb)); | 541 | dev = alloc_irdadev(sizeof(struct smsc_ircc_cb)); |
538 | if (!dev) { | 542 | if (!dev) { |
539 | IRDA_WARNING("%s() can't allocate net device\n", __func__); | 543 | net_warn_ratelimited("%s() can't allocate net device\n", |
544 | __func__); | ||
540 | goto err_out1; | 545 | goto err_out1; |
541 | } | 546 | } |
542 | 547 | ||
@@ -588,8 +593,8 @@ static int smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, | |||
588 | 593 | ||
589 | err = register_netdev(self->netdev); | 594 | err = register_netdev(self->netdev); |
590 | if (err) { | 595 | if (err) { |
591 | IRDA_ERROR("%s, Network device registration failed!\n", | 596 | net_err_ratelimited("%s, Network device registration failed!\n", |
592 | driver_name); | 597 | driver_name); |
593 | goto err_out4; | 598 | goto err_out4; |
594 | } | 599 | } |
595 | 600 | ||
@@ -601,7 +606,7 @@ static int smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, | |||
601 | } | 606 | } |
602 | platform_set_drvdata(self->pldev, self); | 607 | platform_set_drvdata(self->pldev, self); |
603 | 608 | ||
604 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); | 609 | net_info_ratelimited("IrDA: Registered device %s\n", dev->name); |
605 | dev_count++; | 610 | dev_count++; |
606 | 611 | ||
607 | return 0; | 612 | return 0; |
@@ -637,15 +642,15 @@ static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base) | |||
637 | 642 | ||
638 | if (!request_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT, | 643 | if (!request_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT, |
639 | driver_name)) { | 644 | driver_name)) { |
640 | IRDA_WARNING("%s: can't get fir_base of 0x%03x\n", | 645 | net_warn_ratelimited("%s: can't get fir_base of 0x%03x\n", |
641 | __func__, fir_base); | 646 | __func__, fir_base); |
642 | goto out1; | 647 | goto out1; |
643 | } | 648 | } |
644 | 649 | ||
645 | if (!request_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT, | 650 | if (!request_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT, |
646 | driver_name)) { | 651 | driver_name)) { |
647 | IRDA_WARNING("%s: can't get sir_base of 0x%03x\n", | 652 | net_warn_ratelimited("%s: can't get sir_base of 0x%03x\n", |
648 | __func__, sir_base); | 653 | __func__, sir_base); |
649 | goto out2; | 654 | goto out2; |
650 | } | 655 | } |
651 | 656 | ||
@@ -660,13 +665,13 @@ static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base) | |||
660 | irq = (config & IRCC_INTERFACE_IRQ_MASK) >> 4; | 665 | irq = (config & IRCC_INTERFACE_IRQ_MASK) >> 4; |
661 | 666 | ||
662 | if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) { | 667 | if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) { |
663 | IRDA_WARNING("%s(), addr 0x%04x - no device found!\n", | 668 | net_warn_ratelimited("%s(), addr 0x%04x - no device found!\n", |
664 | __func__, fir_base); | 669 | __func__, fir_base); |
665 | goto out3; | 670 | goto out3; |
666 | } | 671 | } |
667 | IRDA_MESSAGE("SMsC IrDA Controller found\n IrCC version %d.%d, " | 672 | net_info_ratelimited("SMsC IrDA Controller found\n IrCC version %d.%d, firport 0x%03x, sirport 0x%03x dma=%d, irq=%d\n", |
668 | "firport 0x%03x, sirport 0x%03x dma=%d, irq=%d\n", | 673 | chip & 0x0f, version, |
669 | chip & 0x0f, version, fir_base, sir_base, dma, irq); | 674 | fir_base, sir_base, dma, irq); |
670 | 675 | ||
671 | return 0; | 676 | return 0; |
672 | 677 | ||
@@ -704,16 +709,16 @@ static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, | |||
704 | 709 | ||
705 | if (irq != IRQ_INVAL) { | 710 | if (irq != IRQ_INVAL) { |
706 | if (irq != chip_irq) | 711 | if (irq != chip_irq) |
707 | IRDA_MESSAGE("%s, Overriding IRQ - chip says %d, using %d\n", | 712 | net_info_ratelimited("%s, Overriding IRQ - chip says %d, using %d\n", |
708 | driver_name, chip_irq, irq); | 713 | driver_name, chip_irq, irq); |
709 | self->io.irq = irq; | 714 | self->io.irq = irq; |
710 | } else | 715 | } else |
711 | self->io.irq = chip_irq; | 716 | self->io.irq = chip_irq; |
712 | 717 | ||
713 | if (dma != DMA_INVAL) { | 718 | if (dma != DMA_INVAL) { |
714 | if (dma != chip_dma) | 719 | if (dma != chip_dma) |
715 | IRDA_MESSAGE("%s, Overriding DMA - chip says %d, using %d\n", | 720 | net_info_ratelimited("%s, Overriding DMA - chip says %d, using %d\n", |
716 | driver_name, chip_dma, dma); | 721 | driver_name, chip_dma, dma); |
717 | self->io.dma = dma; | 722 | self->io.dma = dma; |
718 | } else | 723 | } else |
719 | self->io.dma = chip_dma; | 724 | self->io.dma = chip_dma; |
@@ -852,8 +857,8 @@ static void smsc_ircc_timeout(struct net_device *dev) | |||
852 | struct smsc_ircc_cb *self = netdev_priv(dev); | 857 | struct smsc_ircc_cb *self = netdev_priv(dev); |
853 | unsigned long flags; | 858 | unsigned long flags; |
854 | 859 | ||
855 | IRDA_WARNING("%s: transmit timed out, changing speed to: %d\n", | 860 | net_warn_ratelimited("%s: transmit timed out, changing speed to: %d\n", |
856 | dev->name, self->io.speed); | 861 | dev->name, self->io.speed); |
857 | spin_lock_irqsave(&self->lock, flags); | 862 | spin_lock_irqsave(&self->lock, flags); |
858 | smsc_ircc_sir_start(self); | 863 | smsc_ircc_sir_start(self); |
859 | smsc_ircc_change_speed(self, self->io.speed); | 864 | smsc_ircc_change_speed(self, self->io.speed); |
@@ -1442,17 +1447,15 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self) | |||
1442 | len -= self->io.speed < 4000000 ? 2 : 4; | 1447 | len -= self->io.speed < 4000000 ? 2 : 4; |
1443 | 1448 | ||
1444 | if (len < 2 || len > 2050) { | 1449 | if (len < 2 || len > 2050) { |
1445 | IRDA_WARNING("%s(), bogus len=%d\n", __func__, len); | 1450 | net_warn_ratelimited("%s(), bogus len=%d\n", __func__, len); |
1446 | return; | 1451 | return; |
1447 | } | 1452 | } |
1448 | IRDA_DEBUG(2, "%s: msgcnt = %d, len=%d\n", __func__, msgcnt, len); | 1453 | IRDA_DEBUG(2, "%s: msgcnt = %d, len=%d\n", __func__, msgcnt, len); |
1449 | 1454 | ||
1450 | skb = dev_alloc_skb(len + 1); | 1455 | skb = dev_alloc_skb(len + 1); |
1451 | if (!skb) { | 1456 | if (!skb) |
1452 | IRDA_WARNING("%s(), memory squeeze, dropping frame.\n", | ||
1453 | __func__); | ||
1454 | return; | 1457 | return; |
1455 | } | 1458 | |
1456 | /* Make sure IP header gets aligned */ | 1459 | /* Make sure IP header gets aligned */ |
1457 | skb_reserve(skb, 1); | 1460 | skb_reserve(skb, 1); |
1458 | 1461 | ||
@@ -1730,8 +1733,8 @@ static int smsc_ircc_net_open(struct net_device *dev) | |||
1730 | if (request_dma(self->io.dma, dev->name)) { | 1733 | if (request_dma(self->io.dma, dev->name)) { |
1731 | smsc_ircc_net_close(dev); | 1734 | smsc_ircc_net_close(dev); |
1732 | 1735 | ||
1733 | IRDA_WARNING("%s(), unable to allocate DMA=%d\n", | 1736 | net_warn_ratelimited("%s(), unable to allocate DMA=%d\n", |
1734 | __func__, self->io.dma); | 1737 | __func__, self->io.dma); |
1735 | return -EAGAIN; | 1738 | return -EAGAIN; |
1736 | } | 1739 | } |
1737 | 1740 | ||
@@ -2019,7 +2022,8 @@ static int smsc_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len) | |||
2019 | 2022 | ||
2020 | /* Tx FIFO should be empty! */ | 2023 | /* Tx FIFO should be empty! */ |
2021 | if (!(inb(iobase + UART_LSR) & UART_LSR_THRE)) { | 2024 | if (!(inb(iobase + UART_LSR) & UART_LSR_THRE)) { |
2022 | IRDA_WARNING("%s(), failed, fifo not empty!\n", __func__); | 2025 | net_warn_ratelimited("%s(), failed, fifo not empty!\n", |
2026 | __func__); | ||
2023 | return 0; | 2027 | return 0; |
2024 | } | 2028 | } |
2025 | 2029 | ||
@@ -2058,14 +2062,14 @@ static void smsc_ircc_probe_transceiver(struct smsc_ircc_cb *self) | |||
2058 | 2062 | ||
2059 | for (i = 0; smsc_transceivers[i].name != NULL; i++) | 2063 | for (i = 0; smsc_transceivers[i].name != NULL; i++) |
2060 | if (smsc_transceivers[i].probe(self->io.fir_base)) { | 2064 | if (smsc_transceivers[i].probe(self->io.fir_base)) { |
2061 | IRDA_MESSAGE(" %s transceiver found\n", | 2065 | net_info_ratelimited(" %s transceiver found\n", |
2062 | smsc_transceivers[i].name); | 2066 | smsc_transceivers[i].name); |
2063 | self->transceiver= i + 1; | 2067 | self->transceiver= i + 1; |
2064 | return; | 2068 | return; |
2065 | } | 2069 | } |
2066 | 2070 | ||
2067 | IRDA_MESSAGE("No transceiver found. Defaulting to %s\n", | 2071 | net_info_ratelimited("No transceiver found. Defaulting to %s\n", |
2068 | smsc_transceivers[SMSC_IRCC2_C_DEFAULT_TRANSCEIVER].name); | 2072 | smsc_transceivers[SMSC_IRCC2_C_DEFAULT_TRANSCEIVER].name); |
2069 | 2073 | ||
2070 | self->transceiver = SMSC_IRCC2_C_DEFAULT_TRANSCEIVER; | 2074 | self->transceiver = SMSC_IRCC2_C_DEFAULT_TRANSCEIVER; |
2071 | } | 2075 | } |
@@ -2191,7 +2195,7 @@ static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned shor | |||
2191 | /*printk(KERN_WARNING "%s(): mode: 0x%02x\n", __func__, mode);*/ | 2195 | /*printk(KERN_WARNING "%s(): mode: 0x%02x\n", __func__, mode);*/ |
2192 | 2196 | ||
2193 | if (!(mode & SMSCSIOFLAT_UART2MODE_VAL_IRDA)) | 2197 | if (!(mode & SMSCSIOFLAT_UART2MODE_VAL_IRDA)) |
2194 | IRDA_WARNING("%s(): IrDA not enabled\n", __func__); | 2198 | net_warn_ratelimited("%s(): IrDA not enabled\n", __func__); |
2195 | 2199 | ||
2196 | outb(SMSCSIOFLAT_UART2BASEADDR_REG, cfgbase); | 2200 | outb(SMSCSIOFLAT_UART2BASEADDR_REG, cfgbase); |
2197 | sirbase = inb(cfgbase + 1) << 2; | 2201 | sirbase = inb(cfgbase + 1) << 2; |
@@ -2208,7 +2212,8 @@ static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned shor | |||
2208 | outb(SMSCSIOFLAT_UARTIRQSELECT_REG, cfgbase); | 2212 | outb(SMSCSIOFLAT_UARTIRQSELECT_REG, cfgbase); |
2209 | irq = inb(cfgbase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK; | 2213 | irq = inb(cfgbase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK; |
2210 | 2214 | ||
2211 | IRDA_MESSAGE("%s(): fir: 0x%02x, sir: 0x%02x, dma: %02d, irq: %d, mode: 0x%02x\n", __func__, firbase, sirbase, dma, irq, mode); | 2215 | net_info_ratelimited("%s(): fir: 0x%02x, sir: 0x%02x, dma: %02d, irq: %d, mode: 0x%02x\n", |
2216 | __func__, firbase, sirbase, dma, irq, mode); | ||
2212 | 2217 | ||
2213 | if (firbase && smsc_ircc_open(firbase, sirbase, dma, irq) == 0) | 2218 | if (firbase && smsc_ircc_open(firbase, sirbase, dma, irq) == 0) |
2214 | ret = 0; | 2219 | ret = 0; |
@@ -2329,16 +2334,16 @@ static const struct smsc_chip * __init smsc_ircc_probe(unsigned short cfg_base, | |||
2329 | return NULL; | 2334 | return NULL; |
2330 | } | 2335 | } |
2331 | 2336 | ||
2332 | IRDA_MESSAGE("found SMC SuperIO Chip (devid=0x%02x rev=%02X base=0x%04x): %s%s\n", | 2337 | net_info_ratelimited("found SMC SuperIO Chip (devid=0x%02x rev=%02X base=0x%04x): %s%s\n", |
2333 | devid, rev, cfg_base, type, chip->name); | 2338 | devid, rev, cfg_base, type, chip->name); |
2334 | 2339 | ||
2335 | if (chip->rev > rev) { | 2340 | if (chip->rev > rev) { |
2336 | IRDA_MESSAGE("Revision higher than expected\n"); | 2341 | net_info_ratelimited("Revision higher than expected\n"); |
2337 | return NULL; | 2342 | return NULL; |
2338 | } | 2343 | } |
2339 | 2344 | ||
2340 | if (chip->flags & NoIRDA) | 2345 | if (chip->flags & NoIRDA) |
2341 | IRDA_MESSAGE("chipset does not support IRDA\n"); | 2346 | net_info_ratelimited("chipset does not support IRDA\n"); |
2342 | 2347 | ||
2343 | return chip; | 2348 | return chip; |
2344 | } | 2349 | } |
@@ -2348,8 +2353,8 @@ static int __init smsc_superio_fdc(unsigned short cfg_base) | |||
2348 | int ret = -1; | 2353 | int ret = -1; |
2349 | 2354 | ||
2350 | if (!request_region(cfg_base, 2, driver_name)) { | 2355 | if (!request_region(cfg_base, 2, driver_name)) { |
2351 | IRDA_WARNING("%s: can't get cfg_base of 0x%03x\n", | 2356 | net_warn_ratelimited("%s: can't get cfg_base of 0x%03x\n", |
2352 | __func__, cfg_base); | 2357 | __func__, cfg_base); |
2353 | } else { | 2358 | } else { |
2354 | if (!smsc_superio_flat(fdc_chips_flat, cfg_base, "FDC") || | 2359 | if (!smsc_superio_flat(fdc_chips_flat, cfg_base, "FDC") || |
2355 | !smsc_superio_paged(fdc_chips_paged, cfg_base, "FDC")) | 2360 | !smsc_superio_paged(fdc_chips_paged, cfg_base, "FDC")) |
@@ -2366,8 +2371,8 @@ static int __init smsc_superio_lpc(unsigned short cfg_base) | |||
2366 | int ret = -1; | 2371 | int ret = -1; |
2367 | 2372 | ||
2368 | if (!request_region(cfg_base, 2, driver_name)) { | 2373 | if (!request_region(cfg_base, 2, driver_name)) { |
2369 | IRDA_WARNING("%s: can't get cfg_base of 0x%03x\n", | 2374 | net_warn_ratelimited("%s: can't get cfg_base of 0x%03x\n", |
2370 | __func__, cfg_base); | 2375 | __func__, cfg_base); |
2371 | } else { | 2376 | } else { |
2372 | if (!smsc_superio_flat(lpc_chips_flat, cfg_base, "LPC") || | 2377 | if (!smsc_superio_flat(lpc_chips_flat, cfg_base, "LPC") || |
2373 | !smsc_superio_paged(lpc_chips_paged, cfg_base, "LPC")) | 2378 | !smsc_superio_paged(lpc_chips_paged, cfg_base, "LPC")) |
@@ -2540,8 +2545,8 @@ static int __init preconfigure_smsc_chip(struct | |||
2540 | outb( (conf->sir_io >> 2), iobase + 1); // bits 2-9 of 0x3f8 | 2545 | outb( (conf->sir_io >> 2), iobase + 1); // bits 2-9 of 0x3f8 |
2541 | tmpbyte = inb(iobase + 1); | 2546 | tmpbyte = inb(iobase + 1); |
2542 | if (tmpbyte != (conf->sir_io >> 2) ) { | 2547 | if (tmpbyte != (conf->sir_io >> 2) ) { |
2543 | IRDA_WARNING("ERROR: could not configure SIR ioport.\n"); | 2548 | net_warn_ratelimited("ERROR: could not configure SIR ioport\n"); |
2544 | IRDA_WARNING("Try to supply ircc_cfg argument.\n"); | 2549 | net_warn_ratelimited("Try to supply ircc_cfg argument\n"); |
2545 | return -ENXIO; | 2550 | return -ENXIO; |
2546 | } | 2551 | } |
2547 | 2552 | ||
@@ -2553,7 +2558,7 @@ static int __init preconfigure_smsc_chip(struct | |||
2553 | outb(tmpbyte, iobase + 1); | 2558 | outb(tmpbyte, iobase + 1); |
2554 | tmpbyte = inb(iobase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK; | 2559 | tmpbyte = inb(iobase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK; |
2555 | if (tmpbyte != conf->fir_irq) { | 2560 | if (tmpbyte != conf->fir_irq) { |
2556 | IRDA_WARNING("ERROR: could not configure FIR IRQ channel.\n"); | 2561 | net_warn_ratelimited("ERROR: could not configure FIR IRQ channel\n"); |
2557 | return -ENXIO; | 2562 | return -ENXIO; |
2558 | } | 2563 | } |
2559 | 2564 | ||
@@ -2562,7 +2567,7 @@ static int __init preconfigure_smsc_chip(struct | |||
2562 | outb((conf->fir_io >> 3), iobase + 1); | 2567 | outb((conf->fir_io >> 3), iobase + 1); |
2563 | tmpbyte = inb(iobase + 1); | 2568 | tmpbyte = inb(iobase + 1); |
2564 | if (tmpbyte != (conf->fir_io >> 3) ) { | 2569 | if (tmpbyte != (conf->fir_io >> 3) ) { |
2565 | IRDA_WARNING("ERROR: could not configure FIR I/O port.\n"); | 2570 | net_warn_ratelimited("ERROR: could not configure FIR I/O port\n"); |
2566 | return -ENXIO; | 2571 | return -ENXIO; |
2567 | } | 2572 | } |
2568 | 2573 | ||
@@ -2571,7 +2576,7 @@ static int __init preconfigure_smsc_chip(struct | |||
2571 | outb((conf->fir_dma & LPC47N227_FIRDMASELECT_MASK), iobase + 1); // DMA | 2576 | outb((conf->fir_dma & LPC47N227_FIRDMASELECT_MASK), iobase + 1); // DMA |
2572 | tmpbyte = inb(iobase + 1) & LPC47N227_FIRDMASELECT_MASK; | 2577 | tmpbyte = inb(iobase + 1) & LPC47N227_FIRDMASELECT_MASK; |
2573 | if (tmpbyte != (conf->fir_dma & LPC47N227_FIRDMASELECT_MASK)) { | 2578 | if (tmpbyte != (conf->fir_dma & LPC47N227_FIRDMASELECT_MASK)) { |
2574 | IRDA_WARNING("ERROR: could not configure FIR DMA channel.\n"); | 2579 | net_warn_ratelimited("ERROR: could not configure FIR DMA channel\n"); |
2575 | return -ENXIO; | 2580 | return -ENXIO; |
2576 | } | 2581 | } |
2577 | 2582 | ||
@@ -2628,7 +2633,7 @@ static int __init preconfigure_through_82801(struct pci_dev *dev, | |||
2628 | unsigned short tmpword; | 2633 | unsigned short tmpword; |
2629 | unsigned char tmpbyte; | 2634 | unsigned char tmpbyte; |
2630 | 2635 | ||
2631 | IRDA_MESSAGE("Setting up Intel 82801 controller and SMSC device\n"); | 2636 | net_info_ratelimited("Setting up Intel 82801 controller and SMSC device\n"); |
2632 | /* | 2637 | /* |
2633 | * Select the range for the COMA COM port (SIR) | 2638 | * Select the range for the COMA COM port (SIR) |
2634 | * Register COM_DEC: | 2639 | * Register COM_DEC: |
@@ -2699,8 +2704,8 @@ static int __init preconfigure_through_82801(struct pci_dev *dev, | |||
2699 | tmpword |= 0x0400; | 2704 | tmpword |= 0x0400; |
2700 | break; | 2705 | break; |
2701 | default: | 2706 | default: |
2702 | IRDA_WARNING("Uncommon I/O base address: 0x%04x\n", | 2707 | net_warn_ratelimited("Uncommon I/O base address: 0x%04x\n", |
2703 | conf->cfg_base); | 2708 | conf->cfg_base); |
2704 | break; | 2709 | break; |
2705 | } | 2710 | } |
2706 | tmpword &= 0xfffd; /* disable LPC COMB */ | 2711 | tmpword &= 0xfffd; /* disable LPC COMB */ |
@@ -2800,7 +2805,8 @@ static void __init preconfigure_ali_port(struct pci_dev *dev, | |||
2800 | mask = 0x08; | 2805 | mask = 0x08; |
2801 | break; | 2806 | break; |
2802 | default: | 2807 | default: |
2803 | IRDA_ERROR("Failed to configure unsupported port on ALi 1533 bridge: 0x%04x\n", port); | 2808 | net_err_ratelimited("Failed to configure unsupported port on ALi 1533 bridge: 0x%04x\n", |
2809 | port); | ||
2804 | return; | 2810 | return; |
2805 | } | 2811 | } |
2806 | 2812 | ||
@@ -2808,7 +2814,8 @@ static void __init preconfigure_ali_port(struct pci_dev *dev, | |||
2808 | /* Turn on the right bits */ | 2814 | /* Turn on the right bits */ |
2809 | tmpbyte |= mask; | 2815 | tmpbyte |= mask; |
2810 | pci_write_config_byte(dev, reg, tmpbyte); | 2816 | pci_write_config_byte(dev, reg, tmpbyte); |
2811 | IRDA_MESSAGE("Activated ALi 1533 ISA bridge port 0x%04x.\n", port); | 2817 | net_info_ratelimited("Activated ALi 1533 ISA bridge port 0x%04x\n", |
2818 | port); | ||
2812 | } | 2819 | } |
2813 | 2820 | ||
2814 | static int __init preconfigure_through_ali(struct pci_dev *dev, | 2821 | static int __init preconfigure_through_ali(struct pci_dev *dev, |
@@ -2877,7 +2884,8 @@ static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, | |||
2877 | if (ircc_irq != IRQ_INVAL) | 2884 | if (ircc_irq != IRQ_INVAL) |
2878 | tmpconf.fir_irq = ircc_irq; | 2885 | tmpconf.fir_irq = ircc_irq; |
2879 | 2886 | ||
2880 | IRDA_MESSAGE("Detected unconfigured %s SMSC IrDA chip, pre-configuring device.\n", conf->name); | 2887 | net_info_ratelimited("Detected unconfigured %s SMSC IrDA chip, pre-configuring device\n", |
2888 | conf->name); | ||
2881 | if (conf->preconfigure) | 2889 | if (conf->preconfigure) |
2882 | ret = conf->preconfigure(dev, &tmpconf); | 2890 | ret = conf->preconfigure(dev, &tmpconf); |
2883 | else | 2891 | else |
@@ -2922,8 +2930,8 @@ static void smsc_ircc_set_transceiver_smsc_ircc_atc(int fir_base, u32 speed) | |||
2922 | /* empty */; | 2930 | /* empty */; |
2923 | 2931 | ||
2924 | if (val) | 2932 | if (val) |
2925 | IRDA_WARNING("%s(): ATC: 0x%02x\n", __func__, | 2933 | net_warn_ratelimited("%s(): ATC: 0x%02x\n", |
2926 | inb(fir_base + IRCC_ATC)); | 2934 | __func__, inb(fir_base + IRCC_ATC)); |
2927 | } | 2935 | } |
2928 | 2936 | ||
2929 | /* | 2937 | /* |
diff --git a/drivers/net/irda/tekram-sir.c b/drivers/net/irda/tekram-sir.c index 048a15422844..04db4eac9dc3 100644 --- a/drivers/net/irda/tekram-sir.c +++ b/drivers/net/irda/tekram-sir.c | |||
@@ -179,7 +179,8 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed) | |||
179 | break; | 179 | break; |
180 | 180 | ||
181 | default: | 181 | default: |
182 | IRDA_ERROR("%s - undefined state %d\n", __func__, state); | 182 | net_err_ratelimited("%s - undefined state %d\n", |
183 | __func__, state); | ||
183 | ret = -EINVAL; | 184 | ret = -EINVAL; |
184 | break; | 185 | break; |
185 | } | 186 | } |
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 36e004288ea7..b07b4ccddcad 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -391,7 +391,8 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t *info, unsigned int id) | |||
391 | if (err) | 391 | if (err) |
392 | goto err_out4; | 392 | goto err_out4; |
393 | 393 | ||
394 | IRDA_MESSAGE("IrDA: Registered device %s (via-ircc)\n", dev->name); | 394 | net_info_ratelimited("IrDA: Registered device %s (via-ircc)\n", |
395 | dev->name); | ||
395 | 396 | ||
396 | /* Initialise the hardware.. | 397 | /* Initialise the hardware.. |
397 | */ | 398 | */ |
@@ -510,7 +511,7 @@ static void via_hw_init(struct via_ircc_cb *self) | |||
510 | */ | 511 | */ |
511 | static int via_ircc_read_dongle_id(int iobase) | 512 | static int via_ircc_read_dongle_id(int iobase) |
512 | { | 513 | { |
513 | IRDA_ERROR("via-ircc: dongle probing not supported, please specify dongle_id module parameter.\n"); | 514 | net_err_ratelimited("via-ircc: dongle probing not supported, please specify dongle_id module parameter\n"); |
514 | return 9; /* Default to IBM */ | 515 | return 9; /* Default to IBM */ |
515 | } | 516 | } |
516 | 517 | ||
@@ -652,8 +653,8 @@ static void via_ircc_change_dongle_speed(int iobase, int speed, | |||
652 | break; | 653 | break; |
653 | 654 | ||
654 | default: | 655 | default: |
655 | IRDA_ERROR("%s: Error: dongle_id %d unsupported !\n", | 656 | net_err_ratelimited("%s: Error: dongle_id %d unsupported !\n", |
656 | __func__, dongle_id); | 657 | __func__, dongle_id); |
657 | } | 658 | } |
658 | } | 659 | } |
659 | 660 | ||
@@ -1473,8 +1474,8 @@ static int via_ircc_net_open(struct net_device *dev) | |||
1473 | IRDA_ASSERT(self != NULL, return 0;); | 1474 | IRDA_ASSERT(self != NULL, return 0;); |
1474 | iobase = self->io.fir_base; | 1475 | iobase = self->io.fir_base; |
1475 | if (request_irq(self->io.irq, via_ircc_interrupt, 0, dev->name, dev)) { | 1476 | if (request_irq(self->io.irq, via_ircc_interrupt, 0, dev->name, dev)) { |
1476 | IRDA_WARNING("%s, unable to allocate irq=%d\n", driver_name, | 1477 | net_warn_ratelimited("%s, unable to allocate irq=%d\n", |
1477 | self->io.irq); | 1478 | driver_name, self->io.irq); |
1478 | return -EAGAIN; | 1479 | return -EAGAIN; |
1479 | } | 1480 | } |
1480 | /* | 1481 | /* |
@@ -1482,15 +1483,15 @@ static int via_ircc_net_open(struct net_device *dev) | |||
1482 | * failure. | 1483 | * failure. |
1483 | */ | 1484 | */ |
1484 | if (request_dma(self->io.dma, dev->name)) { | 1485 | if (request_dma(self->io.dma, dev->name)) { |
1485 | IRDA_WARNING("%s, unable to allocate dma=%d\n", driver_name, | 1486 | net_warn_ratelimited("%s, unable to allocate dma=%d\n", |
1486 | self->io.dma); | 1487 | driver_name, self->io.dma); |
1487 | free_irq(self->io.irq, dev); | 1488 | free_irq(self->io.irq, dev); |
1488 | return -EAGAIN; | 1489 | return -EAGAIN; |
1489 | } | 1490 | } |
1490 | if (self->io.dma2 != self->io.dma) { | 1491 | if (self->io.dma2 != self->io.dma) { |
1491 | if (request_dma(self->io.dma2, dev->name)) { | 1492 | if (request_dma(self->io.dma2, dev->name)) { |
1492 | IRDA_WARNING("%s, unable to allocate dma2=%d\n", | 1493 | net_warn_ratelimited("%s, unable to allocate dma2=%d\n", |
1493 | driver_name, self->io.dma2); | 1494 | driver_name, self->io.dma2); |
1494 | free_irq(self->io.irq, dev); | 1495 | free_irq(self->io.irq, dev); |
1495 | free_dma(self->io.dma); | 1496 | free_dma(self->io.dma); |
1496 | return -EAGAIN; | 1497 | return -EAGAIN; |
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index a2e556168286..fd4dedea8e08 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c | |||
@@ -429,8 +429,8 @@ static struct vlsi_ring *vlsi_alloc_ring(struct pci_dev *pdev, struct ring_descr | |||
429 | if (rd->buf == NULL || | 429 | if (rd->buf == NULL || |
430 | !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) { | 430 | !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) { |
431 | if (rd->buf) { | 431 | if (rd->buf) { |
432 | IRDA_ERROR("%s: failed to create PCI-MAP for %p", | 432 | net_err_ratelimited("%s: failed to create PCI-MAP for %p\n", |
433 | __func__, rd->buf); | 433 | __func__, rd->buf); |
434 | kfree(rd->buf); | 434 | kfree(rd->buf); |
435 | rd->buf = NULL; | 435 | rd->buf = NULL; |
436 | } | 436 | } |
@@ -483,11 +483,8 @@ static int vlsi_create_hwif(vlsi_irda_dev_t *idev) | |||
483 | 483 | ||
484 | ringarea = pci_zalloc_consistent(idev->pdev, HW_RING_AREA_SIZE, | 484 | ringarea = pci_zalloc_consistent(idev->pdev, HW_RING_AREA_SIZE, |
485 | &idev->busaddr); | 485 | &idev->busaddr); |
486 | if (!ringarea) { | 486 | if (!ringarea) |
487 | IRDA_ERROR("%s: insufficient memory for descriptor rings\n", | ||
488 | __func__); | ||
489 | goto out; | 487 | goto out; |
490 | } | ||
491 | 488 | ||
492 | hwmap = (struct ring_descr_hw *)ringarea; | 489 | hwmap = (struct ring_descr_hw *)ringarea; |
493 | idev->rx_ring = vlsi_alloc_ring(idev->pdev, hwmap, ringsize[1], | 490 | idev->rx_ring = vlsi_alloc_ring(idev->pdev, hwmap, ringsize[1], |
@@ -581,7 +578,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd) | |||
581 | } | 578 | } |
582 | 579 | ||
583 | if (!rd->skb) { | 580 | if (!rd->skb) { |
584 | IRDA_WARNING("%s: rx packet lost\n", __func__); | 581 | net_warn_ratelimited("%s: rx packet lost\n", __func__); |
585 | ret |= VLSI_RX_DROP; | 582 | ret |= VLSI_RX_DROP; |
586 | goto done; | 583 | goto done; |
587 | } | 584 | } |
@@ -610,8 +607,8 @@ static void vlsi_fill_rx(struct vlsi_ring *r) | |||
610 | 607 | ||
611 | for (rd = ring_last(r); rd != NULL; rd = ring_put(r)) { | 608 | for (rd = ring_last(r); rd != NULL; rd = ring_put(r)) { |
612 | if (rd_is_active(rd)) { | 609 | if (rd_is_active(rd)) { |
613 | IRDA_WARNING("%s: driver bug: rx descr race with hw\n", | 610 | net_warn_ratelimited("%s: driver bug: rx descr race with hw\n", |
614 | __func__); | 611 | __func__); |
615 | vlsi_ring_debug(r); | 612 | vlsi_ring_debug(r); |
616 | break; | 613 | break; |
617 | } | 614 | } |
@@ -670,7 +667,7 @@ static void vlsi_rx_interrupt(struct net_device *ndev) | |||
670 | 667 | ||
671 | if (ring_first(r) == NULL) { | 668 | if (ring_first(r) == NULL) { |
672 | /* we are in big trouble, if this should ever happen */ | 669 | /* we are in big trouble, if this should ever happen */ |
673 | IRDA_ERROR("%s: rx ring exhausted!\n", __func__); | 670 | net_err_ratelimited("%s: rx ring exhausted!\n", __func__); |
674 | vlsi_ring_debug(r); | 671 | vlsi_ring_debug(r); |
675 | } | 672 | } |
676 | else | 673 | else |
@@ -783,8 +780,8 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) | |||
783 | config = IRCFG_SIR | IRCFG_SIRFILT | IRCFG_RXANY; | 780 | config = IRCFG_SIR | IRCFG_SIRFILT | IRCFG_RXANY; |
784 | switch(baudrate) { | 781 | switch(baudrate) { |
785 | default: | 782 | default: |
786 | IRDA_WARNING("%s: undefined baudrate %d - fallback to 9600!\n", | 783 | net_warn_ratelimited("%s: undefined baudrate %d - fallback to 9600!\n", |
787 | __func__, baudrate); | 784 | __func__, baudrate); |
788 | baudrate = 9600; | 785 | baudrate = 9600; |
789 | /* fallthru */ | 786 | /* fallthru */ |
790 | case 2400: | 787 | case 2400: |
@@ -825,14 +822,16 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) | |||
825 | config ^= IRENABLE_SIR_ON; | 822 | config ^= IRENABLE_SIR_ON; |
826 | 823 | ||
827 | if (config != (IRENABLE_PHYANDCLOCK|IRENABLE_ENRXST)) { | 824 | if (config != (IRENABLE_PHYANDCLOCK|IRENABLE_ENRXST)) { |
828 | IRDA_WARNING("%s: failed to set %s mode!\n", __func__, | 825 | net_warn_ratelimited("%s: failed to set %s mode!\n", |
829 | (mode==IFF_SIR)?"SIR":((mode==IFF_MIR)?"MIR":"FIR")); | 826 | __func__, |
827 | mode == IFF_SIR ? "SIR" : | ||
828 | mode == IFF_MIR ? "MIR" : "FIR"); | ||
830 | ret = -1; | 829 | ret = -1; |
831 | } | 830 | } |
832 | else { | 831 | else { |
833 | if (inw(iobase+VLSI_PIO_PHYCTL) != nphyctl) { | 832 | if (inw(iobase+VLSI_PIO_PHYCTL) != nphyctl) { |
834 | IRDA_WARNING("%s: failed to apply baudrate %d\n", | 833 | net_warn_ratelimited("%s: failed to apply baudrate %d\n", |
835 | __func__, baudrate); | 834 | __func__, baudrate); |
836 | ret = -1; | 835 | ret = -1; |
837 | } | 836 | } |
838 | else { | 837 | else { |
@@ -977,8 +976,8 @@ static netdev_tx_t vlsi_hard_start_xmit(struct sk_buff *skb, | |||
977 | */ | 976 | */ |
978 | 977 | ||
979 | if (len >= r->len-5) | 978 | if (len >= r->len-5) |
980 | IRDA_WARNING("%s: possible buffer overflow with SIR wrapping!\n", | 979 | net_warn_ratelimited("%s: possible buffer overflow with SIR wrapping!\n", |
981 | __func__); | 980 | __func__); |
982 | } | 981 | } |
983 | else { | 982 | else { |
984 | /* hw deals with MIR/FIR mode wrapping */ | 983 | /* hw deals with MIR/FIR mode wrapping */ |
@@ -1044,7 +1043,7 @@ static netdev_tx_t vlsi_hard_start_xmit(struct sk_buff *skb, | |||
1044 | drop_unlock: | 1043 | drop_unlock: |
1045 | spin_unlock_irqrestore(&idev->lock, flags); | 1044 | spin_unlock_irqrestore(&idev->lock, flags); |
1046 | drop: | 1045 | drop: |
1047 | IRDA_WARNING("%s: dropping packet - %s\n", __func__, msg); | 1046 | net_warn_ratelimited("%s: dropping packet - %s\n", __func__, msg); |
1048 | dev_kfree_skb_any(skb); | 1047 | dev_kfree_skb_any(skb); |
1049 | ndev->stats.tx_errors++; | 1048 | ndev->stats.tx_errors++; |
1050 | ndev->stats.tx_dropped++; | 1049 | ndev->stats.tx_dropped++; |
@@ -1183,8 +1182,8 @@ static int vlsi_start_clock(struct pci_dev *pdev) | |||
1183 | } | 1182 | } |
1184 | if (count < 3) { | 1183 | if (count < 3) { |
1185 | if (clksrc == 1) { /* explicitly asked for PLL hence bail out */ | 1184 | if (clksrc == 1) { /* explicitly asked for PLL hence bail out */ |
1186 | IRDA_ERROR("%s: no PLL or failed to lock!\n", | 1185 | net_err_ratelimited("%s: no PLL or failed to lock!\n", |
1187 | __func__); | 1186 | __func__); |
1188 | clkctl = CLKCTL_CLKSTP; | 1187 | clkctl = CLKCTL_CLKSTP; |
1189 | pci_write_config_byte(pdev, VLSI_PCI_CLKCTL, clkctl); | 1188 | pci_write_config_byte(pdev, VLSI_PCI_CLKCTL, clkctl); |
1190 | return -1; | 1189 | return -1; |
@@ -1265,7 +1264,7 @@ static int vlsi_init_chip(struct pci_dev *pdev) | |||
1265 | /* start the clock and clean the registers */ | 1264 | /* start the clock and clean the registers */ |
1266 | 1265 | ||
1267 | if (vlsi_start_clock(pdev)) { | 1266 | if (vlsi_start_clock(pdev)) { |
1268 | IRDA_ERROR("%s: no valid clock source\n", __func__); | 1267 | net_err_ratelimited("%s: no valid clock source\n", __func__); |
1269 | return -1; | 1268 | return -1; |
1270 | } | 1269 | } |
1271 | iobase = ndev->base_addr; | 1270 | iobase = ndev->base_addr; |
@@ -1389,8 +1388,8 @@ static void vlsi_tx_timeout(struct net_device *ndev) | |||
1389 | idev->new_baud = idev->baud; /* keep current baudrate */ | 1388 | idev->new_baud = idev->baud; /* keep current baudrate */ |
1390 | 1389 | ||
1391 | if (vlsi_start_hw(idev)) | 1390 | if (vlsi_start_hw(idev)) |
1392 | IRDA_ERROR("%s: failed to restart hw - %s(%s) unusable!\n", | 1391 | net_err_ratelimited("%s: failed to restart hw - %s(%s) unusable!\n", |
1393 | __func__, pci_name(idev->pdev), ndev->name); | 1392 | __func__, pci_name(idev->pdev), ndev->name); |
1394 | else | 1393 | else |
1395 | netif_start_queue(ndev); | 1394 | netif_start_queue(ndev); |
1396 | } | 1395 | } |
@@ -1434,8 +1433,8 @@ static int vlsi_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) | |||
1434 | irq->ifr_receiving = (fifocnt!=0) ? 1 : 0; | 1433 | irq->ifr_receiving = (fifocnt!=0) ? 1 : 0; |
1435 | break; | 1434 | break; |
1436 | default: | 1435 | default: |
1437 | IRDA_WARNING("%s: notsupp - cmd=%04x\n", | 1436 | net_warn_ratelimited("%s: notsupp - cmd=%04x\n", |
1438 | __func__, cmd); | 1437 | __func__, cmd); |
1439 | ret = -EOPNOTSUPP; | 1438 | ret = -EOPNOTSUPP; |
1440 | } | 1439 | } |
1441 | 1440 | ||
@@ -1479,8 +1478,8 @@ static irqreturn_t vlsi_interrupt(int irq, void *dev_instance) | |||
1479 | spin_unlock_irqrestore(&idev->lock,flags); | 1478 | spin_unlock_irqrestore(&idev->lock,flags); |
1480 | 1479 | ||
1481 | if (boguscount <= 0) | 1480 | if (boguscount <= 0) |
1482 | IRDA_MESSAGE("%s: too much work in interrupt!\n", | 1481 | net_info_ratelimited("%s: too much work in interrupt!\n", |
1483 | __func__); | 1482 | __func__); |
1484 | return IRQ_RETVAL(handled); | 1483 | return IRQ_RETVAL(handled); |
1485 | } | 1484 | } |
1486 | 1485 | ||
@@ -1493,7 +1492,7 @@ static int vlsi_open(struct net_device *ndev) | |||
1493 | char hwname[32]; | 1492 | char hwname[32]; |
1494 | 1493 | ||
1495 | if (pci_request_regions(idev->pdev, drivername)) { | 1494 | if (pci_request_regions(idev->pdev, drivername)) { |
1496 | IRDA_WARNING("%s: io resource busy\n", __func__); | 1495 | net_warn_ratelimited("%s: io resource busy\n", __func__); |
1497 | goto errout; | 1496 | goto errout; |
1498 | } | 1497 | } |
1499 | ndev->base_addr = pci_resource_start(idev->pdev,0); | 1498 | ndev->base_addr = pci_resource_start(idev->pdev,0); |
@@ -1507,8 +1506,8 @@ static int vlsi_open(struct net_device *ndev) | |||
1507 | 1506 | ||
1508 | if (request_irq(ndev->irq, vlsi_interrupt, IRQF_SHARED, | 1507 | if (request_irq(ndev->irq, vlsi_interrupt, IRQF_SHARED, |
1509 | drivername, ndev)) { | 1508 | drivername, ndev)) { |
1510 | IRDA_WARNING("%s: couldn't get IRQ: %d\n", | 1509 | net_warn_ratelimited("%s: couldn't get IRQ: %d\n", |
1511 | __func__, ndev->irq); | 1510 | __func__, ndev->irq); |
1512 | goto errout_io; | 1511 | goto errout_io; |
1513 | } | 1512 | } |
1514 | 1513 | ||
@@ -1529,7 +1528,8 @@ static int vlsi_open(struct net_device *ndev) | |||
1529 | 1528 | ||
1530 | netif_start_queue(ndev); | 1529 | netif_start_queue(ndev); |
1531 | 1530 | ||
1532 | IRDA_MESSAGE("%s: device %s operational\n", __func__, ndev->name); | 1531 | net_info_ratelimited("%s: device %s operational\n", |
1532 | __func__, ndev->name); | ||
1533 | 1533 | ||
1534 | return 0; | 1534 | return 0; |
1535 | 1535 | ||
@@ -1563,7 +1563,7 @@ static int vlsi_close(struct net_device *ndev) | |||
1563 | 1563 | ||
1564 | pci_release_regions(idev->pdev); | 1564 | pci_release_regions(idev->pdev); |
1565 | 1565 | ||
1566 | IRDA_MESSAGE("%s: device %s stopped\n", __func__, ndev->name); | 1566 | net_info_ratelimited("%s: device %s stopped\n", __func__, ndev->name); |
1567 | 1567 | ||
1568 | return 0; | 1568 | return 0; |
1569 | } | 1569 | } |
@@ -1590,7 +1590,8 @@ static int vlsi_irda_init(struct net_device *ndev) | |||
1590 | 1590 | ||
1591 | if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW) || | 1591 | if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW) || |
1592 | pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) { | 1592 | pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) { |
1593 | IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __func__); | 1593 | net_err_ratelimited("%s: aborting due to PCI BM-DMA address limitations\n", |
1594 | __func__); | ||
1594 | return -1; | 1595 | return -1; |
1595 | } | 1596 | } |
1596 | 1597 | ||
@@ -1632,19 +1633,19 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1632 | else | 1633 | else |
1633 | pdev->current_state = 0; /* hw must be running now */ | 1634 | pdev->current_state = 0; /* hw must be running now */ |
1634 | 1635 | ||
1635 | IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n", | 1636 | net_info_ratelimited("%s: IrDA PCI controller %s detected\n", |
1636 | drivername, pci_name(pdev)); | 1637 | drivername, pci_name(pdev)); |
1637 | 1638 | ||
1638 | if ( !pci_resource_start(pdev,0) || | 1639 | if ( !pci_resource_start(pdev,0) || |
1639 | !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { | 1640 | !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { |
1640 | IRDA_ERROR("%s: bar 0 invalid", __func__); | 1641 | net_err_ratelimited("%s: bar 0 invalid", __func__); |
1641 | goto out_disable; | 1642 | goto out_disable; |
1642 | } | 1643 | } |
1643 | 1644 | ||
1644 | ndev = alloc_irdadev(sizeof(*idev)); | 1645 | ndev = alloc_irdadev(sizeof(*idev)); |
1645 | if (ndev==NULL) { | 1646 | if (ndev==NULL) { |
1646 | IRDA_ERROR("%s: Unable to allocate device memory.\n", | 1647 | net_err_ratelimited("%s: Unable to allocate device memory.\n", |
1647 | __func__); | 1648 | __func__); |
1648 | goto out_disable; | 1649 | goto out_disable; |
1649 | } | 1650 | } |
1650 | 1651 | ||
@@ -1659,7 +1660,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1659 | goto out_freedev; | 1660 | goto out_freedev; |
1660 | 1661 | ||
1661 | if (register_netdev(ndev) < 0) { | 1662 | if (register_netdev(ndev) < 0) { |
1662 | IRDA_ERROR("%s: register_netdev failed\n", __func__); | 1663 | net_err_ratelimited("%s: register_netdev failed\n", __func__); |
1663 | goto out_freedev; | 1664 | goto out_freedev; |
1664 | } | 1665 | } |
1665 | 1666 | ||
@@ -1669,14 +1670,15 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1669 | ent = proc_create_data(ndev->name, S_IFREG|S_IRUGO, | 1670 | ent = proc_create_data(ndev->name, S_IFREG|S_IRUGO, |
1670 | vlsi_proc_root, VLSI_PROC_FOPS, ndev); | 1671 | vlsi_proc_root, VLSI_PROC_FOPS, ndev); |
1671 | if (!ent) { | 1672 | if (!ent) { |
1672 | IRDA_WARNING("%s: failed to create proc entry\n", | 1673 | net_warn_ratelimited("%s: failed to create proc entry\n", |
1673 | __func__); | 1674 | __func__); |
1674 | } else { | 1675 | } else { |
1675 | proc_set_size(ent, 0); | 1676 | proc_set_size(ent, 0); |
1676 | } | 1677 | } |
1677 | idev->proc_entry = ent; | 1678 | idev->proc_entry = ent; |
1678 | } | 1679 | } |
1679 | IRDA_MESSAGE("%s: registered device %s\n", drivername, ndev->name); | 1680 | net_info_ratelimited("%s: registered device %s\n", |
1681 | drivername, ndev->name); | ||
1680 | 1682 | ||
1681 | pci_set_drvdata(pdev, ndev); | 1683 | pci_set_drvdata(pdev, ndev); |
1682 | mutex_unlock(&idev->mtx); | 1684 | mutex_unlock(&idev->mtx); |
@@ -1698,7 +1700,7 @@ static void vlsi_irda_remove(struct pci_dev *pdev) | |||
1698 | vlsi_irda_dev_t *idev; | 1700 | vlsi_irda_dev_t *idev; |
1699 | 1701 | ||
1700 | if (!ndev) { | 1702 | if (!ndev) { |
1701 | IRDA_ERROR("%s: lost netdevice?\n", drivername); | 1703 | net_err_ratelimited("%s: lost netdevice?\n", drivername); |
1702 | return; | 1704 | return; |
1703 | } | 1705 | } |
1704 | 1706 | ||
@@ -1714,7 +1716,7 @@ static void vlsi_irda_remove(struct pci_dev *pdev) | |||
1714 | 1716 | ||
1715 | free_netdev(ndev); | 1717 | free_netdev(ndev); |
1716 | 1718 | ||
1717 | IRDA_MESSAGE("%s: %s removed\n", drivername, pci_name(pdev)); | 1719 | net_info_ratelimited("%s: %s removed\n", drivername, pci_name(pdev)); |
1718 | } | 1720 | } |
1719 | 1721 | ||
1720 | #ifdef CONFIG_PM | 1722 | #ifdef CONFIG_PM |
@@ -1733,8 +1735,8 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1733 | vlsi_irda_dev_t *idev; | 1735 | vlsi_irda_dev_t *idev; |
1734 | 1736 | ||
1735 | if (!ndev) { | 1737 | if (!ndev) { |
1736 | IRDA_ERROR("%s - %s: no netdevice\n", | 1738 | net_err_ratelimited("%s - %s: no netdevice\n", |
1737 | __func__, pci_name(pdev)); | 1739 | __func__, pci_name(pdev)); |
1738 | return 0; | 1740 | return 0; |
1739 | } | 1741 | } |
1740 | idev = netdev_priv(ndev); | 1742 | idev = netdev_priv(ndev); |
@@ -1745,7 +1747,9 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1745 | pdev->current_state = state.event; | 1747 | pdev->current_state = state.event; |
1746 | } | 1748 | } |
1747 | else | 1749 | else |
1748 | IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __func__, pci_name(pdev), pdev->current_state, state.event); | 1750 | net_err_ratelimited("%s - %s: invalid suspend request %u -> %u\n", |
1751 | __func__, pci_name(pdev), | ||
1752 | pdev->current_state, state.event); | ||
1749 | mutex_unlock(&idev->mtx); | 1753 | mutex_unlock(&idev->mtx); |
1750 | return 0; | 1754 | return 0; |
1751 | } | 1755 | } |
@@ -1772,16 +1776,16 @@ static int vlsi_irda_resume(struct pci_dev *pdev) | |||
1772 | vlsi_irda_dev_t *idev; | 1776 | vlsi_irda_dev_t *idev; |
1773 | 1777 | ||
1774 | if (!ndev) { | 1778 | if (!ndev) { |
1775 | IRDA_ERROR("%s - %s: no netdevice\n", | 1779 | net_err_ratelimited("%s - %s: no netdevice\n", |
1776 | __func__, pci_name(pdev)); | 1780 | __func__, pci_name(pdev)); |
1777 | return 0; | 1781 | return 0; |
1778 | } | 1782 | } |
1779 | idev = netdev_priv(ndev); | 1783 | idev = netdev_priv(ndev); |
1780 | mutex_lock(&idev->mtx); | 1784 | mutex_lock(&idev->mtx); |
1781 | if (pdev->current_state == 0) { | 1785 | if (pdev->current_state == 0) { |
1782 | mutex_unlock(&idev->mtx); | 1786 | mutex_unlock(&idev->mtx); |
1783 | IRDA_WARNING("%s - %s: already resumed\n", | 1787 | net_warn_ratelimited("%s - %s: already resumed\n", |
1784 | __func__, pci_name(pdev)); | 1788 | __func__, pci_name(pdev)); |
1785 | return 0; | 1789 | return 0; |
1786 | } | 1790 | } |
1787 | 1791 | ||
@@ -1800,7 +1804,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev) | |||
1800 | * now we explicitly set pdev->current_state = 0 after enabling the | 1804 | * now we explicitly set pdev->current_state = 0 after enabling the |
1801 | * device and independently resume_ok should catch any garbage config. | 1805 | * device and independently resume_ok should catch any garbage config. |
1802 | */ | 1806 | */ |
1803 | IRDA_WARNING("%s - hm, nothing to resume?\n", __func__); | 1807 | net_warn_ratelimited("%s - hm, nothing to resume?\n", __func__); |
1804 | mutex_unlock(&idev->mtx); | 1808 | mutex_unlock(&idev->mtx); |
1805 | return 0; | 1809 | return 0; |
1806 | } | 1810 | } |
@@ -1837,7 +1841,8 @@ static int __init vlsi_mod_init(void) | |||
1837 | int i, ret; | 1841 | int i, ret; |
1838 | 1842 | ||
1839 | if (clksrc < 0 || clksrc > 3) { | 1843 | if (clksrc < 0 || clksrc > 3) { |
1840 | IRDA_ERROR("%s: invalid clksrc=%d\n", drivername, clksrc); | 1844 | net_err_ratelimited("%s: invalid clksrc=%d\n", |
1845 | drivername, clksrc); | ||
1841 | return -1; | 1846 | return -1; |
1842 | } | 1847 | } |
1843 | 1848 | ||
@@ -1850,7 +1855,10 @@ static int __init vlsi_mod_init(void) | |||
1850 | case 64: | 1855 | case 64: |
1851 | break; | 1856 | break; |
1852 | default: | 1857 | default: |
1853 | IRDA_WARNING("%s: invalid %s ringsize %d, using default=8", drivername, (i)?"rx":"tx", ringsize[i]); | 1858 | net_warn_ratelimited("%s: invalid %s ringsize %d, using default=8\n", |
1859 | drivername, | ||
1860 | i ? "rx" : "tx", | ||
1861 | ringsize[i]); | ||
1854 | ringsize[i] = 8; | 1862 | ringsize[i] = 8; |
1855 | break; | 1863 | break; |
1856 | } | 1864 | } |
diff --git a/drivers/net/irda/vlsi_ir.h b/drivers/net/irda/vlsi_ir.h index 56399204e68c..f9119c6d2a09 100644 --- a/drivers/net/irda/vlsi_ir.h +++ b/drivers/net/irda/vlsi_ir.h | |||
@@ -615,7 +615,8 @@ static inline void rd_set_addr_status(struct ring_descr *rd, dma_addr_t a, u8 s) | |||
615 | */ | 615 | */ |
616 | 616 | ||
617 | if ((a & ~DMA_MASK_MSTRPAGE)>>24 != MSTRPAGE_VALUE) { | 617 | if ((a & ~DMA_MASK_MSTRPAGE)>>24 != MSTRPAGE_VALUE) { |
618 | IRDA_ERROR("%s: pci busaddr inconsistency!\n", __func__); | 618 | net_err_ratelimited("%s: pci busaddr inconsistency!\n", |
619 | __func__); | ||
619 | dump_stack(); | 620 | dump_stack(); |
620 | return; | 621 | return; |
621 | } | 622 | } |
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index 11dbdf36d9c1..86ca123887d6 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c | |||
@@ -236,10 +236,11 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq, | |||
236 | 236 | ||
237 | err = register_netdev(dev); | 237 | err = register_netdev(dev); |
238 | if (err) { | 238 | if (err) { |
239 | IRDA_ERROR("%s(), register_netdevice() failed!\n", __func__); | 239 | net_err_ratelimited("%s(), register_netdevice() failed!\n", |
240 | __func__); | ||
240 | goto err_out3; | 241 | goto err_out3; |
241 | } | 242 | } |
242 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); | 243 | net_info_ratelimited("IrDA: Registered device %s\n", dev->name); |
243 | 244 | ||
244 | /* Need to store self somewhere */ | 245 | /* Need to store self somewhere */ |
245 | dev_self[i] = self; | 246 | dev_self[i] = self; |
@@ -392,8 +393,8 @@ static int w83977af_probe(int iobase, int irq, int dma) | |||
392 | switch_bank(iobase, SET7); | 393 | switch_bank(iobase, SET7); |
393 | outb(0x40, iobase+7); | 394 | outb(0x40, iobase+7); |
394 | 395 | ||
395 | IRDA_MESSAGE("W83977AF (IR) driver loaded. " | 396 | net_info_ratelimited("W83977AF (IR) driver loaded. Version: 0x%02x\n", |
396 | "Version: 0x%02x\n", version); | 397 | version); |
397 | 398 | ||
398 | return 0; | 399 | return 0; |
399 | } else { | 400 | } else { |
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h index 42aa054aa67f..4ff18bdc63df 100644 --- a/include/net/irda/irda.h +++ b/include/net/irda/irda.h | |||
@@ -77,10 +77,6 @@ do { if(!(expr)) { \ | |||
77 | #define IRDA_ASSERT_LABEL(label) | 77 | #define IRDA_ASSERT_LABEL(label) |
78 | #endif /* CONFIG_IRDA_DEBUG */ | 78 | #endif /* CONFIG_IRDA_DEBUG */ |
79 | 79 | ||
80 | #define IRDA_ERROR net_err_ratelimited | ||
81 | #define IRDA_WARNING net_warn_ratelimited | ||
82 | #define IRDA_MESSAGE net_info_ratelimited | ||
83 | |||
84 | /* | 80 | /* |
85 | * Magic numbers used by Linux-IrDA. Random numbers which must be unique to | 81 | * Magic numbers used by Linux-IrDA. Random numbers which must be unique to |
86 | * give the best protection | 82 | * give the best protection |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 980bc2670a13..4b04ae06b288 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -201,16 +201,16 @@ static void irda_connect_confirm(void *instance, void *sap, | |||
201 | switch (sk->sk_type) { | 201 | switch (sk->sk_type) { |
202 | case SOCK_STREAM: | 202 | case SOCK_STREAM: |
203 | if (max_sdu_size != 0) { | 203 | if (max_sdu_size != 0) { |
204 | IRDA_ERROR("%s: max_sdu_size must be 0\n", | 204 | net_err_ratelimited("%s: max_sdu_size must be 0\n", |
205 | __func__); | 205 | __func__); |
206 | return; | 206 | return; |
207 | } | 207 | } |
208 | self->max_data_size = irttp_get_max_seg_size(self->tsap); | 208 | self->max_data_size = irttp_get_max_seg_size(self->tsap); |
209 | break; | 209 | break; |
210 | case SOCK_SEQPACKET: | 210 | case SOCK_SEQPACKET: |
211 | if (max_sdu_size == 0) { | 211 | if (max_sdu_size == 0) { |
212 | IRDA_ERROR("%s: max_sdu_size cannot be 0\n", | 212 | net_err_ratelimited("%s: max_sdu_size cannot be 0\n", |
213 | __func__); | 213 | __func__); |
214 | return; | 214 | return; |
215 | } | 215 | } |
216 | self->max_data_size = max_sdu_size; | 216 | self->max_data_size = max_sdu_size; |
@@ -262,8 +262,8 @@ static void irda_connect_indication(void *instance, void *sap, | |||
262 | switch (sk->sk_type) { | 262 | switch (sk->sk_type) { |
263 | case SOCK_STREAM: | 263 | case SOCK_STREAM: |
264 | if (max_sdu_size != 0) { | 264 | if (max_sdu_size != 0) { |
265 | IRDA_ERROR("%s: max_sdu_size must be 0\n", | 265 | net_err_ratelimited("%s: max_sdu_size must be 0\n", |
266 | __func__); | 266 | __func__); |
267 | kfree_skb(skb); | 267 | kfree_skb(skb); |
268 | return; | 268 | return; |
269 | } | 269 | } |
@@ -271,8 +271,8 @@ static void irda_connect_indication(void *instance, void *sap, | |||
271 | break; | 271 | break; |
272 | case SOCK_SEQPACKET: | 272 | case SOCK_SEQPACKET: |
273 | if (max_sdu_size == 0) { | 273 | if (max_sdu_size == 0) { |
274 | IRDA_ERROR("%s: max_sdu_size cannot be 0\n", | 274 | net_err_ratelimited("%s: max_sdu_size cannot be 0\n", |
275 | __func__); | 275 | __func__); |
276 | kfree_skb(skb); | 276 | kfree_skb(skb); |
277 | return; | 277 | return; |
278 | } | 278 | } |
@@ -368,7 +368,7 @@ static void irda_getvalue_confirm(int result, __u16 obj_id, | |||
368 | 368 | ||
369 | self = priv; | 369 | self = priv; |
370 | if (!self) { | 370 | if (!self) { |
371 | IRDA_WARNING("%s: lost myself!\n", __func__); | 371 | net_warn_ratelimited("%s: lost myself!\n", __func__); |
372 | return; | 372 | return; |
373 | } | 373 | } |
374 | 374 | ||
@@ -417,7 +417,7 @@ static void irda_selective_discovery_indication(discinfo_t *discovery, | |||
417 | 417 | ||
418 | self = priv; | 418 | self = priv; |
419 | if (!self) { | 419 | if (!self) { |
420 | IRDA_WARNING("%s: lost myself!\n", __func__); | 420 | net_warn_ratelimited("%s: lost myself!\n", __func__); |
421 | return; | 421 | return; |
422 | } | 422 | } |
423 | 423 | ||
@@ -505,7 +505,7 @@ static int irda_open_lsap(struct irda_sock *self, int pid) | |||
505 | notify_t notify; | 505 | notify_t notify; |
506 | 506 | ||
507 | if (self->lsap) { | 507 | if (self->lsap) { |
508 | IRDA_WARNING("%s(), busy!\n", __func__); | 508 | net_warn_ratelimited("%s(), busy!\n", __func__); |
509 | return -EBUSY; | 509 | return -EBUSY; |
510 | } | 510 | } |
511 | 511 | ||
@@ -541,8 +541,8 @@ static int irda_find_lsap_sel(struct irda_sock *self, char *name) | |||
541 | IRDA_DEBUG(2, "%s(%p, %s)\n", __func__, self, name); | 541 | IRDA_DEBUG(2, "%s(%p, %s)\n", __func__, self, name); |
542 | 542 | ||
543 | if (self->iriap) { | 543 | if (self->iriap) { |
544 | IRDA_WARNING("%s(): busy with a previous query\n", | 544 | net_warn_ratelimited("%s(): busy with a previous query\n", |
545 | __func__); | 545 | __func__); |
546 | return -EBUSY; | 546 | return -EBUSY; |
547 | } | 547 | } |
548 | 548 | ||
@@ -2129,8 +2129,8 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, | |||
2129 | __func__, opt); | 2129 | __func__, opt); |
2130 | self->max_sdu_size_rx = opt; | 2130 | self->max_sdu_size_rx = opt; |
2131 | } else { | 2131 | } else { |
2132 | IRDA_WARNING("%s: not allowed to set MAXSDUSIZE for this socket type!\n", | 2132 | net_warn_ratelimited("%s: not allowed to set MAXSDUSIZE for this socket type!\n", |
2133 | __func__); | 2133 | __func__); |
2134 | err = -ENOPROTOOPT; | 2134 | err = -ENOPROTOOPT; |
2135 | goto out; | 2135 | goto out; |
2136 | } | 2136 | } |
@@ -2441,8 +2441,8 @@ bed: | |||
2441 | 2441 | ||
2442 | /* Check that we can proceed with IAP */ | 2442 | /* Check that we can proceed with IAP */ |
2443 | if (self->iriap) { | 2443 | if (self->iriap) { |
2444 | IRDA_WARNING("%s: busy with a previous query\n", | 2444 | net_warn_ratelimited("%s: busy with a previous query\n", |
2445 | __func__); | 2445 | __func__); |
2446 | kfree(ias_opt); | 2446 | kfree(ias_opt); |
2447 | err = -EBUSY; | 2447 | err = -EBUSY; |
2448 | goto out; | 2448 | goto out; |
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index 4490a675b1bb..b77fe8c86238 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c | |||
@@ -69,7 +69,8 @@ static int __init ircomm_init(void) | |||
69 | { | 69 | { |
70 | ircomm = hashbin_new(HB_LOCK); | 70 | ircomm = hashbin_new(HB_LOCK); |
71 | if (ircomm == NULL) { | 71 | if (ircomm == NULL) { |
72 | IRDA_ERROR("%s(), can't allocate hashbin!\n", __func__); | 72 | net_err_ratelimited("%s(), can't allocate hashbin!\n", |
73 | __func__); | ||
73 | return -ENOMEM; | 74 | return -ENOMEM; |
74 | } | 75 | } |
75 | 76 | ||
@@ -83,7 +84,7 @@ static int __init ircomm_init(void) | |||
83 | } | 84 | } |
84 | #endif /* CONFIG_PROC_FS */ | 85 | #endif /* CONFIG_PROC_FS */ |
85 | 86 | ||
86 | IRDA_MESSAGE("IrCOMM protocol (Dag Brattli)\n"); | 87 | net_info_ratelimited("IrCOMM protocol (Dag Brattli)\n"); |
87 | 88 | ||
88 | return 0; | 89 | return 0; |
89 | } | 90 | } |
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c index 6536114adf37..05767e3ef0d2 100644 --- a/net/irda/ircomm/ircomm_lmp.c +++ b/net/irda/ircomm/ircomm_lmp.c | |||
@@ -204,7 +204,7 @@ static int ircomm_lmp_data_request(struct ircomm_cb *self, | |||
204 | } | 204 | } |
205 | ret = irlmp_data_request(self->lsap, skb); | 205 | ret = irlmp_data_request(self->lsap, skb); |
206 | if (ret) { | 206 | if (ret) { |
207 | IRDA_ERROR("%s(), failed\n", __func__); | 207 | net_err_ratelimited("%s(), failed\n", __func__); |
208 | /* irlmp_data_request already free the packet */ | 208 | /* irlmp_data_request already free the packet */ |
209 | } | 209 | } |
210 | 210 | ||
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c index f80b1a6a244b..c203fbb8cdd5 100644 --- a/net/irda/ircomm/ircomm_param.c +++ b/net/irda/ircomm/ircomm_param.c | |||
@@ -130,7 +130,8 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush) | |||
130 | count = irda_param_insert(self, pi, skb_tail_pointer(skb), | 130 | count = irda_param_insert(self, pi, skb_tail_pointer(skb), |
131 | skb_tailroom(skb), &ircomm_param_info); | 131 | skb_tailroom(skb), &ircomm_param_info); |
132 | if (count < 0) { | 132 | if (count < 0) { |
133 | IRDA_WARNING("%s(), no room for parameter!\n", __func__); | 133 | net_warn_ratelimited("%s(), no room for parameter!\n", |
134 | __func__); | ||
134 | spin_unlock_irqrestore(&self->spinlock, flags); | 135 | spin_unlock_irqrestore(&self->spinlock, flags); |
135 | return -1; | 136 | return -1; |
136 | } | 137 | } |
diff --git a/net/irda/ircomm/ircomm_ttp.c b/net/irda/ircomm/ircomm_ttp.c index d362d711b79c..abe9a5ab8d34 100644 --- a/net/irda/ircomm/ircomm_ttp.c +++ b/net/irda/ircomm/ircomm_ttp.c | |||
@@ -188,7 +188,7 @@ static int ircomm_ttp_data_request(struct ircomm_cb *self, | |||
188 | 188 | ||
189 | ret = irttp_data_request(self->tsap, skb); | 189 | ret = irttp_data_request(self->tsap, skb); |
190 | if (ret) { | 190 | if (ret) { |
191 | IRDA_ERROR("%s(), failed\n", __func__); | 191 | net_err_ratelimited("%s(), failed\n", __func__); |
192 | /* irttp_data_request already free the packet */ | 192 | /* irttp_data_request already free the packet */ |
193 | } | 193 | } |
194 | 194 | ||
@@ -237,8 +237,8 @@ static void ircomm_ttp_connect_confirm(void *instance, void *sap, | |||
237 | IRDA_ASSERT(qos != NULL, goto out;); | 237 | IRDA_ASSERT(qos != NULL, goto out;); |
238 | 238 | ||
239 | if (max_sdu_size != TTP_SAR_DISABLE) { | 239 | if (max_sdu_size != TTP_SAR_DISABLE) { |
240 | IRDA_ERROR("%s(), SAR not allowed for IrCOMM!\n", | 240 | net_err_ratelimited("%s(), SAR not allowed for IrCOMM!\n", |
241 | __func__); | 241 | __func__); |
242 | goto out; | 242 | goto out; |
243 | } | 243 | } |
244 | 244 | ||
@@ -278,8 +278,8 @@ static void ircomm_ttp_connect_indication(void *instance, void *sap, | |||
278 | IRDA_ASSERT(qos != NULL, goto out;); | 278 | IRDA_ASSERT(qos != NULL, goto out;); |
279 | 279 | ||
280 | if (max_sdu_size != TTP_SAR_DISABLE) { | 280 | if (max_sdu_size != TTP_SAR_DISABLE) { |
281 | IRDA_ERROR("%s(), SAR not allowed for IrCOMM!\n", | 281 | net_err_ratelimited("%s(), SAR not allowed for IrCOMM!\n", |
282 | __func__); | 282 | __func__); |
283 | goto out; | 283 | goto out; |
284 | } | 284 | } |
285 | 285 | ||
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 61ceb4cdb4a2..11b0a5ed0252 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
@@ -147,7 +147,8 @@ static int __init ircomm_tty_init(void) | |||
147 | return -ENOMEM; | 147 | return -ENOMEM; |
148 | ircomm_tty = hashbin_new(HB_LOCK); | 148 | ircomm_tty = hashbin_new(HB_LOCK); |
149 | if (ircomm_tty == NULL) { | 149 | if (ircomm_tty == NULL) { |
150 | IRDA_ERROR("%s(), can't allocate hashbin!\n", __func__); | 150 | net_err_ratelimited("%s(), can't allocate hashbin!\n", |
151 | __func__); | ||
151 | put_tty_driver(driver); | 152 | put_tty_driver(driver); |
152 | return -ENOMEM; | 153 | return -ENOMEM; |
153 | } | 154 | } |
@@ -163,8 +164,8 @@ static int __init ircomm_tty_init(void) | |||
163 | driver->flags = TTY_DRIVER_REAL_RAW; | 164 | driver->flags = TTY_DRIVER_REAL_RAW; |
164 | tty_set_operations(driver, &ops); | 165 | tty_set_operations(driver, &ops); |
165 | if (tty_register_driver(driver)) { | 166 | if (tty_register_driver(driver)) { |
166 | IRDA_ERROR("%s(): Couldn't register serial driver\n", | 167 | net_err_ratelimited("%s(): Couldn't register serial driver\n", |
167 | __func__); | 168 | __func__); |
168 | put_tty_driver(driver); | 169 | put_tty_driver(driver); |
169 | return -1; | 170 | return -1; |
170 | } | 171 | } |
@@ -199,8 +200,8 @@ static void __exit ircomm_tty_cleanup(void) | |||
199 | 200 | ||
200 | ret = tty_unregister_driver(driver); | 201 | ret = tty_unregister_driver(driver); |
201 | if (ret) { | 202 | if (ret) { |
202 | IRDA_ERROR("%s(), failed to unregister driver\n", | 203 | net_err_ratelimited("%s(), failed to unregister driver\n", |
203 | __func__); | 204 | __func__); |
204 | return; | 205 | return; |
205 | } | 206 | } |
206 | 207 | ||
@@ -256,7 +257,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self) | |||
256 | /* Connect IrCOMM link with remote device */ | 257 | /* Connect IrCOMM link with remote device */ |
257 | ret = ircomm_tty_attach_cable(self); | 258 | ret = ircomm_tty_attach_cable(self); |
258 | if (ret < 0) { | 259 | if (ret < 0) { |
259 | IRDA_ERROR("%s(), error attaching cable!\n", __func__); | 260 | net_err_ratelimited("%s(), error attaching cable!\n", __func__); |
260 | goto err; | 261 | goto err; |
261 | } | 262 | } |
262 | 263 | ||
@@ -389,10 +390,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty) | |||
389 | if (!self) { | 390 | if (!self) { |
390 | /* No, so make new instance */ | 391 | /* No, so make new instance */ |
391 | self = kzalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL); | 392 | self = kzalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL); |
392 | if (self == NULL) { | 393 | if (self == NULL) |
393 | IRDA_ERROR("%s(), kmalloc failed!\n", __func__); | ||
394 | return -ENOMEM; | 394 | return -ENOMEM; |
395 | } | ||
396 | 395 | ||
397 | tty_port_init(&self->port); | 396 | tty_port_init(&self->port); |
398 | self->port.ops = &ircomm_port_ops; | 397 | self->port.ops = &ircomm_port_ops; |
@@ -469,8 +468,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
469 | 468 | ||
470 | if (wait_event_interruptible(self->port.close_wait, | 469 | if (wait_event_interruptible(self->port.close_wait, |
471 | !test_bit(ASYNCB_CLOSING, &self->port.flags))) { | 470 | !test_bit(ASYNCB_CLOSING, &self->port.flags))) { |
472 | IRDA_WARNING("%s - got signal while blocking on ASYNC_CLOSING!\n", | 471 | net_warn_ratelimited("%s - got signal while blocking on ASYNC_CLOSING!\n", |
473 | __func__); | 472 | __func__); |
474 | return -ERESTARTSYS; | 473 | return -ERESTARTSYS; |
475 | } | 474 | } |
476 | 475 | ||
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c index 2ee87bf387cc..211904419f68 100644 --- a/net/irda/ircomm/ircomm_tty_attach.c +++ b/net/irda/ircomm/ircomm_tty_attach.c | |||
@@ -694,8 +694,8 @@ static int ircomm_tty_state_idle(struct ircomm_tty_cb *self, | |||
694 | self->saddr = info->saddr; | 694 | self->saddr = info->saddr; |
695 | 695 | ||
696 | if (self->iriap) { | 696 | if (self->iriap) { |
697 | IRDA_WARNING("%s(), busy with a previous query\n", | 697 | net_warn_ratelimited("%s(), busy with a previous query\n", |
698 | __func__); | 698 | __func__); |
699 | return -EBUSY; | 699 | return -EBUSY; |
700 | } | 700 | } |
701 | 701 | ||
@@ -752,8 +752,8 @@ static int ircomm_tty_state_search(struct ircomm_tty_cb *self, | |||
752 | self->saddr = info->saddr; | 752 | self->saddr = info->saddr; |
753 | 753 | ||
754 | if (self->iriap) { | 754 | if (self->iriap) { |
755 | IRDA_WARNING("%s(), busy with a previous query\n", | 755 | net_warn_ratelimited("%s(), busy with a previous query\n", |
756 | __func__); | 756 | __func__); |
757 | return -EBUSY; | 757 | return -EBUSY; |
758 | } | 758 | } |
759 | 759 | ||
@@ -822,8 +822,8 @@ static int ircomm_tty_state_query_parameters(struct ircomm_tty_cb *self, | |||
822 | switch (event) { | 822 | switch (event) { |
823 | case IRCOMM_TTY_GOT_PARAMETERS: | 823 | case IRCOMM_TTY_GOT_PARAMETERS: |
824 | if (self->iriap) { | 824 | if (self->iriap) { |
825 | IRDA_WARNING("%s(), busy with a previous query\n", | 825 | net_warn_ratelimited("%s(), busy with a previous query\n", |
826 | __func__); | 826 | __func__); |
827 | return -EBUSY; | 827 | return -EBUSY; |
828 | } | 828 | } |
829 | 829 | ||
diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c index ce943853c38d..7eb06e08f8ed 100644 --- a/net/irda/ircomm/ircomm_tty_ioctl.c +++ b/net/irda/ircomm/ircomm_tty_ioctl.c | |||
@@ -93,7 +93,8 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self, | |||
93 | self->settings.flow_control |= IRCOMM_RTS_CTS_IN; | 93 | self->settings.flow_control |= IRCOMM_RTS_CTS_IN; |
94 | /* This got me. Bummer. Jean II */ | 94 | /* This got me. Bummer. Jean II */ |
95 | if (self->service_type == IRCOMM_3_WIRE_RAW) | 95 | if (self->service_type == IRCOMM_3_WIRE_RAW) |
96 | IRDA_WARNING("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __func__); | 96 | net_warn_ratelimited("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", |
97 | __func__); | ||
97 | } else { | 98 | } else { |
98 | self->port.flags &= ~ASYNC_CTS_FLOW; | 99 | self->port.flags &= ~ASYNC_CTS_FLOW; |
99 | self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN; | 100 | self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN; |
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index 9e0d909390fd..96788db1dc31 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
@@ -63,14 +63,14 @@ int __init irda_device_init( void) | |||
63 | { | 63 | { |
64 | dongles = hashbin_new(HB_NOLOCK); | 64 | dongles = hashbin_new(HB_NOLOCK); |
65 | if (dongles == NULL) { | 65 | if (dongles == NULL) { |
66 | IRDA_WARNING("IrDA: Can't allocate dongles hashbin!\n"); | 66 | net_warn_ratelimited("IrDA: Can't allocate dongles hashbin!\n"); |
67 | return -ENOMEM; | 67 | return -ENOMEM; |
68 | } | 68 | } |
69 | spin_lock_init(&dongles->hb_spinlock); | 69 | spin_lock_init(&dongles->hb_spinlock); |
70 | 70 | ||
71 | tasks = hashbin_new(HB_LOCK); | 71 | tasks = hashbin_new(HB_LOCK); |
72 | if (tasks == NULL) { | 72 | if (tasks == NULL) { |
73 | IRDA_WARNING("IrDA: Can't allocate tasks hashbin!\n"); | 73 | net_warn_ratelimited("IrDA: Can't allocate tasks hashbin!\n"); |
74 | hashbin_delete(dongles, NULL); | 74 | hashbin_delete(dongles, NULL); |
75 | return -ENOMEM; | 75 | return -ENOMEM; |
76 | } | 76 | } |
@@ -84,8 +84,8 @@ int __init irda_device_init( void) | |||
84 | static void leftover_dongle(void *arg) | 84 | static void leftover_dongle(void *arg) |
85 | { | 85 | { |
86 | struct dongle_reg *reg = arg; | 86 | struct dongle_reg *reg = arg; |
87 | IRDA_WARNING("IrDA: Dongle type %x not unregistered\n", | 87 | net_warn_ratelimited("IrDA: Dongle type %x not unregistered\n", |
88 | reg->type); | 88 | reg->type); |
89 | } | 89 | } |
90 | 90 | ||
91 | void irda_device_cleanup(void) | 91 | void irda_device_cleanup(void) |
@@ -150,8 +150,8 @@ int irda_device_is_receiving(struct net_device *dev) | |||
150 | IRDA_DEBUG(2, "%s()\n", __func__); | 150 | IRDA_DEBUG(2, "%s()\n", __func__); |
151 | 151 | ||
152 | if (!dev->netdev_ops->ndo_do_ioctl) { | 152 | if (!dev->netdev_ops->ndo_do_ioctl) { |
153 | IRDA_ERROR("%s: do_ioctl not impl. by device driver\n", | 153 | net_err_ratelimited("%s: do_ioctl not impl. by device driver\n", |
154 | __func__); | 154 | __func__); |
155 | return -1; | 155 | return -1; |
156 | } | 156 | } |
157 | 157 | ||
@@ -201,15 +201,15 @@ static int irda_task_kick(struct irda_task *task) | |||
201 | do { | 201 | do { |
202 | timeout = task->function(task); | 202 | timeout = task->function(task); |
203 | if (count++ > 100) { | 203 | if (count++ > 100) { |
204 | IRDA_ERROR("%s: error in task handler!\n", | 204 | net_err_ratelimited("%s: error in task handler!\n", |
205 | __func__); | 205 | __func__); |
206 | irda_task_delete(task); | 206 | irda_task_delete(task); |
207 | return TRUE; | 207 | return TRUE; |
208 | } | 208 | } |
209 | } while ((timeout == 0) && (task->state != IRDA_TASK_DONE)); | 209 | } while ((timeout == 0) && (task->state != IRDA_TASK_DONE)); |
210 | 210 | ||
211 | if (timeout < 0) { | 211 | if (timeout < 0) { |
212 | IRDA_ERROR("%s: Error executing task!\n", __func__); | 212 | net_err_ratelimited("%s: Error executing task!\n", __func__); |
213 | irda_task_delete(task); | 213 | irda_task_delete(task); |
214 | return TRUE; | 214 | return TRUE; |
215 | } | 215 | } |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index e1b37f5a2691..c2ea3443f669 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -110,8 +110,8 @@ int __init iriap_init(void) | |||
110 | /* Object repository - defined in irias_object.c */ | 110 | /* Object repository - defined in irias_object.c */ |
111 | irias_objects = hashbin_new(HB_LOCK); | 111 | irias_objects = hashbin_new(HB_LOCK); |
112 | if (!irias_objects) { | 112 | if (!irias_objects) { |
113 | IRDA_WARNING("%s: Can't allocate irias_objects hashbin!\n", | 113 | net_warn_ratelimited("%s: Can't allocate irias_objects hashbin!\n", |
114 | __func__); | 114 | __func__); |
115 | hashbin_delete(iriap, NULL); | 115 | hashbin_delete(iriap, NULL); |
116 | return -ENOMEM; | 116 | return -ENOMEM; |
117 | } | 117 | } |
@@ -180,10 +180,8 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv, | |||
180 | IRDA_DEBUG(2, "%s()\n", __func__); | 180 | IRDA_DEBUG(2, "%s()\n", __func__); |
181 | 181 | ||
182 | self = kzalloc(sizeof(*self), GFP_ATOMIC); | 182 | self = kzalloc(sizeof(*self), GFP_ATOMIC); |
183 | if (!self) { | 183 | if (!self) |
184 | IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); | ||
185 | return NULL; | 184 | return NULL; |
186 | } | ||
187 | 185 | ||
188 | /* | 186 | /* |
189 | * Initialize instance | 187 | * Initialize instance |
@@ -283,7 +281,8 @@ static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode) | |||
283 | 281 | ||
284 | self->lsap = irlmp_open_lsap(slsap_sel, ¬ify, 0); | 282 | self->lsap = irlmp_open_lsap(slsap_sel, ¬ify, 0); |
285 | if (self->lsap == NULL) { | 283 | if (self->lsap == NULL) { |
286 | IRDA_ERROR("%s: Unable to allocated LSAP!\n", __func__); | 284 | net_err_ratelimited("%s: Unable to allocated LSAP!\n", |
285 | __func__); | ||
287 | return -1; | 286 | return -1; |
288 | } | 287 | } |
289 | self->slsap_sel = self->lsap->slsap_sel; | 288 | self->slsap_sel = self->lsap->slsap_sel; |
@@ -859,9 +858,8 @@ static int iriap_data_indication(void *instance, void *sap, | |||
859 | } | 858 | } |
860 | opcode = frame[0]; | 859 | opcode = frame[0]; |
861 | if (~opcode & IAP_LST) { | 860 | if (~opcode & IAP_LST) { |
862 | IRDA_WARNING("%s:, IrIAS multiframe commands or " | 861 | net_warn_ratelimited("%s:, IrIAS multiframe commands or results is not implemented yet!\n", |
863 | "results is not implemented yet!\n", | 862 | __func__); |
864 | __func__); | ||
865 | goto out; | 863 | goto out; |
866 | } | 864 | } |
867 | 865 | ||
@@ -945,16 +943,16 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb) | |||
945 | 943 | ||
946 | opcode = fp[0]; | 944 | opcode = fp[0]; |
947 | if (~opcode & 0x80) { | 945 | if (~opcode & 0x80) { |
948 | IRDA_WARNING("%s: IrIAS multiframe commands or results " | 946 | net_warn_ratelimited("%s: IrIAS multiframe commands or results is not implemented yet!\n", |
949 | "is not implemented yet!\n", __func__); | 947 | __func__); |
950 | return; | 948 | return; |
951 | } | 949 | } |
952 | opcode &= 0x7f; /* Mask away LST bit */ | 950 | opcode &= 0x7f; /* Mask away LST bit */ |
953 | 951 | ||
954 | switch (opcode) { | 952 | switch (opcode) { |
955 | case GET_INFO_BASE: | 953 | case GET_INFO_BASE: |
956 | IRDA_WARNING("%s: GetInfoBaseDetails not implemented yet!\n", | 954 | net_warn_ratelimited("%s: GetInfoBaseDetails not implemented yet!\n", |
957 | __func__); | 955 | __func__); |
958 | break; | 956 | break; |
959 | case GET_VALUE_BY_CLASS: | 957 | case GET_VALUE_BY_CLASS: |
960 | iriap_getvaluebyclass_indication(self, skb); | 958 | iriap_getvaluebyclass_indication(self, skb); |
diff --git a/net/irda/iriap_event.c b/net/irda/iriap_event.c index 703774e29e32..09de4efc73a7 100644 --- a/net/irda/iriap_event.c +++ b/net/irda/iriap_event.c | |||
@@ -368,10 +368,8 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event, | |||
368 | switch (event) { | 368 | switch (event) { |
369 | case IAP_LM_CONNECT_INDICATION: | 369 | case IAP_LM_CONNECT_INDICATION: |
370 | tx_skb = alloc_skb(LMP_MAX_HEADER, GFP_ATOMIC); | 370 | tx_skb = alloc_skb(LMP_MAX_HEADER, GFP_ATOMIC); |
371 | if (tx_skb == NULL) { | 371 | if (tx_skb == NULL) |
372 | IRDA_WARNING("%s: unable to malloc!\n", __func__); | ||
373 | return; | 372 | return; |
374 | } | ||
375 | 373 | ||
376 | /* Reserve space for MUX_CONTROL and LAP header */ | 374 | /* Reserve space for MUX_CONTROL and LAP header */ |
377 | skb_reserve(tx_skb, LMP_MAX_HEADER); | 375 | skb_reserve(tx_skb, LMP_MAX_HEADER); |
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index f07ed9fd5792..cd53692fe8c9 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
@@ -52,16 +52,16 @@ struct ias_object *irias_new_object( char *name, int id) | |||
52 | 52 | ||
53 | obj = kzalloc(sizeof(struct ias_object), GFP_ATOMIC); | 53 | obj = kzalloc(sizeof(struct ias_object), GFP_ATOMIC); |
54 | if (obj == NULL) { | 54 | if (obj == NULL) { |
55 | IRDA_WARNING("%s(), Unable to allocate object!\n", | 55 | net_warn_ratelimited("%s(), Unable to allocate object!\n", |
56 | __func__); | 56 | __func__); |
57 | return NULL; | 57 | return NULL; |
58 | } | 58 | } |
59 | 59 | ||
60 | obj->magic = IAS_OBJECT_MAGIC; | 60 | obj->magic = IAS_OBJECT_MAGIC; |
61 | obj->name = kstrndup(name, IAS_MAX_CLASSNAME, GFP_ATOMIC); | 61 | obj->name = kstrndup(name, IAS_MAX_CLASSNAME, GFP_ATOMIC); |
62 | if (!obj->name) { | 62 | if (!obj->name) { |
63 | IRDA_WARNING("%s(), Unable to allocate name!\n", | 63 | net_warn_ratelimited("%s(), Unable to allocate name!\n", |
64 | __func__); | 64 | __func__); |
65 | kfree(obj); | 65 | kfree(obj); |
66 | return NULL; | 66 | return NULL; |
67 | } | 67 | } |
@@ -73,8 +73,8 @@ struct ias_object *irias_new_object( char *name, int id) | |||
73 | obj->attribs = hashbin_new(HB_LOCK); | 73 | obj->attribs = hashbin_new(HB_LOCK); |
74 | 74 | ||
75 | if (obj->attribs == NULL) { | 75 | if (obj->attribs == NULL) { |
76 | IRDA_WARNING("%s(), Unable to allocate attribs!\n", | 76 | net_warn_ratelimited("%s(), Unable to allocate attribs!\n", |
77 | __func__); | 77 | __func__); |
78 | kfree(obj->name); | 78 | kfree(obj->name); |
79 | kfree(obj); | 79 | kfree(obj); |
80 | return NULL; | 80 | return NULL; |
@@ -269,8 +269,8 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name, | |||
269 | /* Find object */ | 269 | /* Find object */ |
270 | obj = hashbin_lock_find(irias_objects, 0, obj_name); | 270 | obj = hashbin_lock_find(irias_objects, 0, obj_name); |
271 | if (obj == NULL) { | 271 | if (obj == NULL) { |
272 | IRDA_WARNING("%s: Unable to find object: %s\n", __func__, | 272 | net_warn_ratelimited("%s: Unable to find object: %s\n", |
273 | obj_name); | 273 | __func__, obj_name); |
274 | return -1; | 274 | return -1; |
275 | } | 275 | } |
276 | 276 | ||
@@ -280,8 +280,8 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name, | |||
280 | /* Find attribute */ | 280 | /* Find attribute */ |
281 | attrib = hashbin_find(obj->attribs, 0, attrib_name); | 281 | attrib = hashbin_find(obj->attribs, 0, attrib_name); |
282 | if (attrib == NULL) { | 282 | if (attrib == NULL) { |
283 | IRDA_WARNING("%s: Unable to find attribute: %s\n", | 283 | net_warn_ratelimited("%s: Unable to find attribute: %s\n", |
284 | __func__, attrib_name); | 284 | __func__, attrib_name); |
285 | spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags); | 285 | spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags); |
286 | return -1; | 286 | return -1; |
287 | } | 287 | } |
@@ -322,8 +322,8 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, | |||
322 | 322 | ||
323 | attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC); | 323 | attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC); |
324 | if (attrib == NULL) { | 324 | if (attrib == NULL) { |
325 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 325 | net_warn_ratelimited("%s: Unable to allocate attribute!\n", |
326 | __func__); | 326 | __func__); |
327 | return; | 327 | return; |
328 | } | 328 | } |
329 | 329 | ||
@@ -333,8 +333,8 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, | |||
333 | /* Insert value */ | 333 | /* Insert value */ |
334 | attrib->value = irias_new_integer_value(value); | 334 | attrib->value = irias_new_integer_value(value); |
335 | if (!attrib->name || !attrib->value) { | 335 | if (!attrib->name || !attrib->value) { |
336 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 336 | net_warn_ratelimited("%s: Unable to allocate attribute!\n", |
337 | __func__); | 337 | __func__); |
338 | if (attrib->value) | 338 | if (attrib->value) |
339 | irias_delete_value(attrib->value); | 339 | irias_delete_value(attrib->value); |
340 | kfree(attrib->name); | 340 | kfree(attrib->name); |
@@ -366,8 +366,8 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, | |||
366 | 366 | ||
367 | attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC); | 367 | attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC); |
368 | if (attrib == NULL) { | 368 | if (attrib == NULL) { |
369 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 369 | net_warn_ratelimited("%s: Unable to allocate attribute!\n", |
370 | __func__); | 370 | __func__); |
371 | return; | 371 | return; |
372 | } | 372 | } |
373 | 373 | ||
@@ -376,8 +376,8 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, | |||
376 | 376 | ||
377 | attrib->value = irias_new_octseq_value( octets, len); | 377 | attrib->value = irias_new_octseq_value( octets, len); |
378 | if (!attrib->name || !attrib->value) { | 378 | if (!attrib->name || !attrib->value) { |
379 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 379 | net_warn_ratelimited("%s: Unable to allocate attribute!\n", |
380 | __func__); | 380 | __func__); |
381 | if (attrib->value) | 381 | if (attrib->value) |
382 | irias_delete_value(attrib->value); | 382 | irias_delete_value(attrib->value); |
383 | kfree(attrib->name); | 383 | kfree(attrib->name); |
@@ -408,8 +408,8 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, | |||
408 | 408 | ||
409 | attrib = kzalloc(sizeof( struct ias_attrib), GFP_ATOMIC); | 409 | attrib = kzalloc(sizeof( struct ias_attrib), GFP_ATOMIC); |
410 | if (attrib == NULL) { | 410 | if (attrib == NULL) { |
411 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 411 | net_warn_ratelimited("%s: Unable to allocate attribute!\n", |
412 | __func__); | 412 | __func__); |
413 | return; | 413 | return; |
414 | } | 414 | } |
415 | 415 | ||
@@ -418,8 +418,8 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, | |||
418 | 418 | ||
419 | attrib->value = irias_new_string_value(value); | 419 | attrib->value = irias_new_string_value(value); |
420 | if (!attrib->name || !attrib->value) { | 420 | if (!attrib->name || !attrib->value) { |
421 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 421 | net_warn_ratelimited("%s: Unable to allocate attribute!\n", |
422 | __func__); | 422 | __func__); |
423 | if (attrib->value) | 423 | if (attrib->value) |
424 | irias_delete_value(attrib->value); | 424 | irias_delete_value(attrib->value); |
425 | kfree(attrib->name); | 425 | kfree(attrib->name); |
@@ -442,10 +442,8 @@ struct ias_value *irias_new_integer_value(int integer) | |||
442 | struct ias_value *value; | 442 | struct ias_value *value; |
443 | 443 | ||
444 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); | 444 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); |
445 | if (value == NULL) { | 445 | if (value == NULL) |
446 | IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); | ||
447 | return NULL; | 446 | return NULL; |
448 | } | ||
449 | 447 | ||
450 | value->type = IAS_INTEGER; | 448 | value->type = IAS_INTEGER; |
451 | value->len = 4; | 449 | value->len = 4; |
@@ -467,16 +465,14 @@ struct ias_value *irias_new_string_value(char *string) | |||
467 | struct ias_value *value; | 465 | struct ias_value *value; |
468 | 466 | ||
469 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); | 467 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); |
470 | if (value == NULL) { | 468 | if (value == NULL) |
471 | IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); | ||
472 | return NULL; | 469 | return NULL; |
473 | } | ||
474 | 470 | ||
475 | value->type = IAS_STRING; | 471 | value->type = IAS_STRING; |
476 | value->charset = CS_ASCII; | 472 | value->charset = CS_ASCII; |
477 | value->t.string = kstrndup(string, IAS_MAX_STRING, GFP_ATOMIC); | 473 | value->t.string = kstrndup(string, IAS_MAX_STRING, GFP_ATOMIC); |
478 | if (!value->t.string) { | 474 | if (!value->t.string) { |
479 | IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); | 475 | net_warn_ratelimited("%s: Unable to kmalloc!\n", __func__); |
480 | kfree(value); | 476 | kfree(value); |
481 | return NULL; | 477 | return NULL; |
482 | } | 478 | } |
@@ -498,10 +494,8 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) | |||
498 | struct ias_value *value; | 494 | struct ias_value *value; |
499 | 495 | ||
500 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); | 496 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); |
501 | if (value == NULL) { | 497 | if (value == NULL) |
502 | IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); | ||
503 | return NULL; | 498 | return NULL; |
504 | } | ||
505 | 499 | ||
506 | value->type = IAS_OCT_SEQ; | 500 | value->type = IAS_OCT_SEQ; |
507 | /* Check length */ | 501 | /* Check length */ |
@@ -511,7 +505,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) | |||
511 | 505 | ||
512 | value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC); | 506 | value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC); |
513 | if (value->t.oct_seq == NULL){ | 507 | if (value->t.oct_seq == NULL){ |
514 | IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); | 508 | net_warn_ratelimited("%s: Unable to kmalloc!\n", __func__); |
515 | kfree(value); | 509 | kfree(value); |
516 | return NULL; | 510 | return NULL; |
517 | } | 511 | } |
@@ -523,10 +517,8 @@ struct ias_value *irias_new_missing_value(void) | |||
523 | struct ias_value *value; | 517 | struct ias_value *value; |
524 | 518 | ||
525 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); | 519 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); |
526 | if (value == NULL) { | 520 | if (value == NULL) |
527 | IRDA_WARNING("%s: Unable to kmalloc!\n", __func__); | ||
528 | return NULL; | 521 | return NULL; |
529 | } | ||
530 | 522 | ||
531 | value->type = IAS_MISSING; | 523 | value->type = IAS_MISSING; |
532 | 524 | ||
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c index 42cf1390ce9c..f8eea02843f5 100644 --- a/net/irda/irlan/irlan_client.c +++ b/net/irda/irlan/irlan_client.c | |||
@@ -323,34 +323,34 @@ static void print_ret_code(__u8 code) | |||
323 | printk(KERN_INFO "Success\n"); | 323 | printk(KERN_INFO "Success\n"); |
324 | break; | 324 | break; |
325 | case 1: | 325 | case 1: |
326 | IRDA_WARNING("IrLAN: Insufficient resources\n"); | 326 | net_warn_ratelimited("IrLAN: Insufficient resources\n"); |
327 | break; | 327 | break; |
328 | case 2: | 328 | case 2: |
329 | IRDA_WARNING("IrLAN: Invalid command format\n"); | 329 | net_warn_ratelimited("IrLAN: Invalid command format\n"); |
330 | break; | 330 | break; |
331 | case 3: | 331 | case 3: |
332 | IRDA_WARNING("IrLAN: Command not supported\n"); | 332 | net_warn_ratelimited("IrLAN: Command not supported\n"); |
333 | break; | 333 | break; |
334 | case 4: | 334 | case 4: |
335 | IRDA_WARNING("IrLAN: Parameter not supported\n"); | 335 | net_warn_ratelimited("IrLAN: Parameter not supported\n"); |
336 | break; | 336 | break; |
337 | case 5: | 337 | case 5: |
338 | IRDA_WARNING("IrLAN: Value not supported\n"); | 338 | net_warn_ratelimited("IrLAN: Value not supported\n"); |
339 | break; | 339 | break; |
340 | case 6: | 340 | case 6: |
341 | IRDA_WARNING("IrLAN: Not open\n"); | 341 | net_warn_ratelimited("IrLAN: Not open\n"); |
342 | break; | 342 | break; |
343 | case 7: | 343 | case 7: |
344 | IRDA_WARNING("IrLAN: Authentication required\n"); | 344 | net_warn_ratelimited("IrLAN: Authentication required\n"); |
345 | break; | 345 | break; |
346 | case 8: | 346 | case 8: |
347 | IRDA_WARNING("IrLAN: Invalid password\n"); | 347 | net_warn_ratelimited("IrLAN: Invalid password\n"); |
348 | break; | 348 | break; |
349 | case 9: | 349 | case 9: |
350 | IRDA_WARNING("IrLAN: Protocol error\n"); | 350 | net_warn_ratelimited("IrLAN: Protocol error\n"); |
351 | break; | 351 | break; |
352 | case 255: | 352 | case 255: |
353 | IRDA_WARNING("IrLAN: Asynchronous status\n"); | 353 | net_warn_ratelimited("IrLAN: Asynchronous status\n"); |
354 | break; | 354 | break; |
355 | } | 355 | } |
356 | } | 356 | } |
@@ -380,7 +380,7 @@ void irlan_client_parse_response(struct irlan_cb *self, struct sk_buff *skb) | |||
380 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 380 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
381 | 381 | ||
382 | if (!skb) { | 382 | if (!skb) { |
383 | IRDA_ERROR("%s(), Got NULL skb!\n", __func__); | 383 | net_err_ratelimited("%s(), Got NULL skb!\n", __func__); |
384 | return; | 384 | return; |
385 | } | 385 | } |
386 | frame = skb->data; | 386 | frame = skb->data; |
diff --git a/net/irda/irlan/irlan_client_event.c b/net/irda/irlan/irlan_client_event.c index 8d5a8ebc444f..f9d11bf38157 100644 --- a/net/irda/irlan/irlan_client_event.c +++ b/net/irda/irlan/irlan_client_event.c | |||
@@ -100,8 +100,8 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, | |||
100 | switch (event) { | 100 | switch (event) { |
101 | case IRLAN_DISCOVERY_INDICATION: | 101 | case IRLAN_DISCOVERY_INDICATION: |
102 | if (self->client.iriap) { | 102 | if (self->client.iriap) { |
103 | IRDA_WARNING("%s(), busy with a previous query\n", | 103 | net_warn_ratelimited("%s(), busy with a previous query\n", |
104 | __func__); | 104 | __func__); |
105 | return -EBUSY; | 105 | return -EBUSY; |
106 | } | 106 | } |
107 | 107 | ||
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index 5a2d0a695529..cc60b4a282ae 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
@@ -437,7 +437,8 @@ static void irlan_disconnect_indication(void *instance, | |||
437 | IRDA_DEBUG(2, "%s(), IrLMP connect failed\n", __func__ ); | 437 | IRDA_DEBUG(2, "%s(), IrLMP connect failed\n", __func__ ); |
438 | break; | 438 | break; |
439 | default: | 439 | default: |
440 | IRDA_ERROR("%s(), Unknown disconnect reason\n", __func__); | 440 | net_err_ratelimited("%s(), Unknown disconnect reason\n", |
441 | __func__); | ||
441 | break; | 442 | break; |
442 | } | 443 | } |
443 | 444 | ||
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c index dc13f1a45f2f..94b948ef36f9 100644 --- a/net/irda/irlan/irlan_eth.c +++ b/net/irda/irlan/irlan_eth.c | |||
@@ -320,7 +320,7 @@ static void irlan_eth_set_multicast_list(struct net_device *dev) | |||
320 | 320 | ||
321 | if (dev->flags & IFF_PROMISC) { | 321 | if (dev->flags & IFF_PROMISC) { |
322 | /* Enable promiscuous mode */ | 322 | /* Enable promiscuous mode */ |
323 | IRDA_WARNING("Promiscuous mode not implemented by IrLAN!\n"); | 323 | net_warn_ratelimited("Promiscuous mode not implemented by IrLAN!\n"); |
324 | } else if ((dev->flags & IFF_ALLMULTI) || | 324 | } else if ((dev->flags & IFF_ALLMULTI) || |
325 | netdev_mc_count(dev) > HW_MAX_ADDRS) { | 325 | netdev_mc_count(dev) > HW_MAX_ADDRS) { |
326 | /* Disable promiscuous mode, use normal mode. */ | 326 | /* Disable promiscuous mode, use normal mode. */ |
diff --git a/net/irda/irlap.c b/net/irda/irlap.c index a778df55f5d6..2e3bc6ccf4b5 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c | |||
@@ -85,8 +85,8 @@ int __init irlap_init(void) | |||
85 | /* Allocate master array */ | 85 | /* Allocate master array */ |
86 | irlap = hashbin_new(HB_LOCK); | 86 | irlap = hashbin_new(HB_LOCK); |
87 | if (irlap == NULL) { | 87 | if (irlap == NULL) { |
88 | IRDA_ERROR("%s: can't allocate irlap hashbin!\n", | 88 | net_err_ratelimited("%s: can't allocate irlap hashbin!\n", |
89 | __func__); | 89 | __func__); |
90 | return -ENOMEM; | 90 | return -ENOMEM; |
91 | } | 91 | } |
92 | 92 | ||
@@ -491,7 +491,8 @@ void irlap_disconnect_indication(struct irlap_cb *self, LAP_REASON reason) | |||
491 | reason, NULL); | 491 | reason, NULL); |
492 | break; | 492 | break; |
493 | default: | 493 | default: |
494 | IRDA_ERROR("%s: Unknown reason %d\n", __func__, reason); | 494 | net_err_ratelimited("%s: Unknown reason %d\n", |
495 | __func__, reason); | ||
495 | } | 496 | } |
496 | } | 497 | } |
497 | 498 | ||
@@ -540,8 +541,8 @@ void irlap_discovery_request(struct irlap_cb *self, discovery_t *discovery) | |||
540 | self->discovery_log = hashbin_new(HB_NOLOCK); | 541 | self->discovery_log = hashbin_new(HB_NOLOCK); |
541 | 542 | ||
542 | if (self->discovery_log == NULL) { | 543 | if (self->discovery_log == NULL) { |
543 | IRDA_WARNING("%s(), Unable to allocate discovery log!\n", | 544 | net_warn_ratelimited("%s(), Unable to allocate discovery log!\n", |
544 | __func__); | 545 | __func__); |
545 | return; | 546 | return; |
546 | } | 547 | } |
547 | 548 | ||
@@ -625,10 +626,10 @@ void irlap_status_indication(struct irlap_cb *self, int quality_of_link) | |||
625 | { | 626 | { |
626 | switch (quality_of_link) { | 627 | switch (quality_of_link) { |
627 | case STATUS_NO_ACTIVITY: | 628 | case STATUS_NO_ACTIVITY: |
628 | IRDA_MESSAGE("IrLAP, no activity on link!\n"); | 629 | net_info_ratelimited("IrLAP, no activity on link!\n"); |
629 | break; | 630 | break; |
630 | case STATUS_NOISY: | 631 | case STATUS_NOISY: |
631 | IRDA_MESSAGE("IrLAP, noisy link!\n"); | 632 | net_info_ratelimited("IrLAP, noisy link!\n"); |
632 | break; | 633 | break; |
633 | default: | 634 | default: |
634 | break; | 635 | break; |
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c index ccd214f9d196..5f4a84eb35c7 100644 --- a/net/irda/irlap_event.c +++ b/net/irda/irlap_event.c | |||
@@ -572,9 +572,8 @@ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event, | |||
572 | info->discovery->data.daddr); | 572 | info->discovery->data.daddr); |
573 | 573 | ||
574 | if (!self->discovery_log) { | 574 | if (!self->discovery_log) { |
575 | IRDA_WARNING("%s: discovery log is gone! " | 575 | net_warn_ratelimited("%s: discovery log is gone! maybe the discovery timeout has been set too short?\n", |
576 | "maybe the discovery timeout has been set" | 576 | __func__); |
577 | " too short?\n", __func__); | ||
578 | break; | 577 | break; |
579 | } | 578 | } |
580 | hashbin_insert(self->discovery_log, | 579 | hashbin_insert(self->discovery_log, |
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index a37998c6273d..90ef03658a74 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c | |||
@@ -421,7 +421,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, | |||
421 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); | 421 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); |
422 | 422 | ||
423 | if (!pskb_may_pull(skb, sizeof(struct xid_frame))) { | 423 | if (!pskb_may_pull(skb, sizeof(struct xid_frame))) { |
424 | IRDA_ERROR("%s: frame too short!\n", __func__); | 424 | net_err_ratelimited("%s: frame too short!\n", __func__); |
425 | return; | 425 | return; |
426 | } | 426 | } |
427 | 427 | ||
@@ -438,7 +438,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, | |||
438 | } | 438 | } |
439 | 439 | ||
440 | if ((discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { | 440 | if ((discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { |
441 | IRDA_WARNING("%s: kmalloc failed!\n", __func__); | 441 | net_warn_ratelimited("%s: kmalloc failed!\n", __func__); |
442 | return; | 442 | return; |
443 | } | 443 | } |
444 | 444 | ||
@@ -492,7 +492,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, | |||
492 | char *text; | 492 | char *text; |
493 | 493 | ||
494 | if (!pskb_may_pull(skb, sizeof(struct xid_frame))) { | 494 | if (!pskb_may_pull(skb, sizeof(struct xid_frame))) { |
495 | IRDA_ERROR("%s: frame too short!\n", __func__); | 495 | net_err_ratelimited("%s: frame too short!\n", __func__); |
496 | return; | 496 | return; |
497 | } | 497 | } |
498 | 498 | ||
@@ -536,8 +536,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, | |||
536 | /* Check if things are sane at this point... */ | 536 | /* Check if things are sane at this point... */ |
537 | if((discovery_info == NULL) || | 537 | if((discovery_info == NULL) || |
538 | !pskb_may_pull(skb, 3)) { | 538 | !pskb_may_pull(skb, 3)) { |
539 | IRDA_ERROR("%s: discovery frame too short!\n", | 539 | net_err_ratelimited("%s: discovery frame too short!\n", |
540 | __func__); | 540 | __func__); |
541 | return; | 541 | return; |
542 | } | 542 | } |
543 | 543 | ||
@@ -545,10 +545,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, | |||
545 | * We now have some discovery info to deliver! | 545 | * We now have some discovery info to deliver! |
546 | */ | 546 | */ |
547 | discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC); | 547 | discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC); |
548 | if (!discovery) { | 548 | if (!discovery) |
549 | IRDA_WARNING("%s: unable to malloc!\n", __func__); | ||
550 | return; | 549 | return; |
551 | } | ||
552 | 550 | ||
553 | discovery->data.daddr = info->daddr; | 551 | discovery->data.daddr = info->daddr; |
554 | discovery->data.saddr = self->saddr; | 552 | discovery->data.saddr = self->saddr; |
@@ -1170,7 +1168,7 @@ static void irlap_recv_frmr_frame(struct irlap_cb *self, struct sk_buff *skb, | |||
1170 | IRDA_ASSERT(info != NULL, return;); | 1168 | IRDA_ASSERT(info != NULL, return;); |
1171 | 1169 | ||
1172 | if (!pskb_may_pull(skb, 4)) { | 1170 | if (!pskb_may_pull(skb, 4)) { |
1173 | IRDA_ERROR("%s: frame too short!\n", __func__); | 1171 | net_err_ratelimited("%s: frame too short!\n", __func__); |
1174 | return; | 1172 | return; |
1175 | } | 1173 | } |
1176 | 1174 | ||
@@ -1259,7 +1257,7 @@ static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb, | |||
1259 | IRDA_DEBUG(2, "%s()\n", __func__); | 1257 | IRDA_DEBUG(2, "%s()\n", __func__); |
1260 | 1258 | ||
1261 | if (!pskb_may_pull(skb, sizeof(*frame))) { | 1259 | if (!pskb_may_pull(skb, sizeof(*frame))) { |
1262 | IRDA_ERROR("%s: frame too short!\n", __func__); | 1260 | net_err_ratelimited("%s: frame too short!\n", __func__); |
1263 | return; | 1261 | return; |
1264 | } | 1262 | } |
1265 | frame = (struct test_frame *) skb->data; | 1263 | frame = (struct test_frame *) skb->data; |
@@ -1328,13 +1326,13 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1328 | * share and non linear skbs. This should never happen, so | 1326 | * share and non linear skbs. This should never happen, so |
1329 | * we don't need to be clever about it. Jean II */ | 1327 | * we don't need to be clever about it. Jean II */ |
1330 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) { | 1328 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) { |
1331 | IRDA_ERROR("%s: can't clone shared skb!\n", __func__); | 1329 | net_err_ratelimited("%s: can't clone shared skb!\n", __func__); |
1332 | goto err; | 1330 | goto err; |
1333 | } | 1331 | } |
1334 | 1332 | ||
1335 | /* Check if frame is large enough for parsing */ | 1333 | /* Check if frame is large enough for parsing */ |
1336 | if (!pskb_may_pull(skb, 2)) { | 1334 | if (!pskb_may_pull(skb, 2)) { |
1337 | IRDA_ERROR("%s: frame too short!\n", __func__); | 1335 | net_err_ratelimited("%s: frame too short!\n", __func__); |
1338 | goto err; | 1336 | goto err; |
1339 | } | 1337 | } |
1340 | 1338 | ||
@@ -1383,8 +1381,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1383 | irlap_recv_srej_frame(self, skb, &info, command); | 1381 | irlap_recv_srej_frame(self, skb, &info, command); |
1384 | break; | 1382 | break; |
1385 | default: | 1383 | default: |
1386 | IRDA_WARNING("%s: Unknown S-frame %02x received!\n", | 1384 | net_warn_ratelimited("%s: Unknown S-frame %02x received!\n", |
1387 | __func__, info.control); | 1385 | __func__, info.control); |
1388 | break; | 1386 | break; |
1389 | } | 1387 | } |
1390 | goto out; | 1388 | goto out; |
@@ -1421,8 +1419,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1421 | irlap_recv_ui_frame(self, skb, &info); | 1419 | irlap_recv_ui_frame(self, skb, &info); |
1422 | break; | 1420 | break; |
1423 | default: | 1421 | default: |
1424 | IRDA_WARNING("%s: Unknown frame %02x received!\n", | 1422 | net_warn_ratelimited("%s: Unknown frame %02x received!\n", |
1425 | __func__, info.control); | 1423 | __func__, info.control); |
1426 | break; | 1424 | break; |
1427 | } | 1425 | } |
1428 | out: | 1426 | out: |
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index a5f28d421ea8..6178e71f3a51 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c | |||
@@ -170,10 +170,8 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid) | |||
170 | 170 | ||
171 | /* Allocate new instance of a LSAP connection */ | 171 | /* Allocate new instance of a LSAP connection */ |
172 | self = kzalloc(sizeof(struct lsap_cb), GFP_ATOMIC); | 172 | self = kzalloc(sizeof(struct lsap_cb), GFP_ATOMIC); |
173 | if (self == NULL) { | 173 | if (self == NULL) |
174 | IRDA_ERROR("%s: can't allocate memory\n", __func__); | ||
175 | return NULL; | 174 | return NULL; |
176 | } | ||
177 | 175 | ||
178 | self->magic = LMP_LSAP_MAGIC; | 176 | self->magic = LMP_LSAP_MAGIC; |
179 | self->slsap_sel = slsap_sel; | 177 | self->slsap_sel = slsap_sel; |
@@ -297,10 +295,8 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify) | |||
297 | * Allocate new instance of a LSAP connection | 295 | * Allocate new instance of a LSAP connection |
298 | */ | 296 | */ |
299 | lap = kzalloc(sizeof(struct lap_cb), GFP_KERNEL); | 297 | lap = kzalloc(sizeof(struct lap_cb), GFP_KERNEL); |
300 | if (lap == NULL) { | 298 | if (lap == NULL) |
301 | IRDA_ERROR("%s: unable to kmalloc\n", __func__); | ||
302 | return; | 299 | return; |
303 | } | ||
304 | 300 | ||
305 | lap->irlap = irlap; | 301 | lap->irlap = irlap; |
306 | lap->magic = LMP_LAP_MAGIC; | 302 | lap->magic = LMP_LAP_MAGIC; |
@@ -311,7 +307,8 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify) | |||
311 | #endif | 307 | #endif |
312 | lap->lsaps = hashbin_new(HB_LOCK); | 308 | lap->lsaps = hashbin_new(HB_LOCK); |
313 | if (lap->lsaps == NULL) { | 309 | if (lap->lsaps == NULL) { |
314 | IRDA_WARNING("%s(), unable to kmalloc lsaps\n", __func__); | 310 | net_warn_ratelimited("%s(), unable to kmalloc lsaps\n", |
311 | __func__); | ||
315 | kfree(lap); | 312 | kfree(lap); |
316 | return; | 313 | return; |
317 | } | 314 | } |
@@ -852,8 +849,8 @@ void irlmp_do_discovery(int nslots) | |||
852 | 849 | ||
853 | /* Make sure the value is sane */ | 850 | /* Make sure the value is sane */ |
854 | if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){ | 851 | if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){ |
855 | IRDA_WARNING("%s: invalid value for number of slots!\n", | 852 | net_warn_ratelimited("%s: invalid value for number of slots!\n", |
856 | __func__); | 853 | __func__); |
857 | nslots = sysctl_discovery_slots = 8; | 854 | nslots = sysctl_discovery_slots = 8; |
858 | } | 855 | } |
859 | 856 | ||
@@ -1799,8 +1796,8 @@ static __u8 irlmp_find_free_slsap(void) | |||
1799 | 1796 | ||
1800 | /* Make sure we terminate the loop */ | 1797 | /* Make sure we terminate the loop */ |
1801 | if (wrapped++) { | 1798 | if (wrapped++) { |
1802 | IRDA_ERROR("%s: no more free LSAPs !\n", | 1799 | net_err_ratelimited("%s: no more free LSAPs !\n", |
1803 | __func__); | 1800 | __func__); |
1804 | return 0; | 1801 | return 0; |
1805 | } | 1802 | } |
1806 | } | 1803 | } |
diff --git a/net/irda/irlmp_event.c b/net/irda/irlmp_event.c index 9505a7d06f1a..30e51f9f4baf 100644 --- a/net/irda/irlmp_event.c +++ b/net/irda/irlmp_event.c | |||
@@ -508,8 +508,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, | |||
508 | IRDA_DEBUG(4, "%s(), LM_CONNECT_REQUEST\n", __func__); | 508 | IRDA_DEBUG(4, "%s(), LM_CONNECT_REQUEST\n", __func__); |
509 | 509 | ||
510 | if (self->conn_skb) { | 510 | if (self->conn_skb) { |
511 | IRDA_WARNING("%s: busy with another request!\n", | 511 | net_warn_ratelimited("%s: busy with another request!\n", |
512 | __func__); | 512 | __func__); |
513 | return -EBUSY; | 513 | return -EBUSY; |
514 | } | 514 | } |
515 | /* Don't forget to refcount it (see irlmp_connect_request()) */ | 515 | /* Don't forget to refcount it (see irlmp_connect_request()) */ |
@@ -525,8 +525,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, | |||
525 | break; | 525 | break; |
526 | case LM_CONNECT_INDICATION: | 526 | case LM_CONNECT_INDICATION: |
527 | if (self->conn_skb) { | 527 | if (self->conn_skb) { |
528 | IRDA_WARNING("%s: busy with another request!\n", | 528 | net_warn_ratelimited("%s: busy with another request!\n", |
529 | __func__); | 529 | __func__); |
530 | return -EBUSY; | 530 | return -EBUSY; |
531 | } | 531 | } |
532 | /* Don't forget to refcount it (see irlap_driver_rcv()) */ | 532 | /* Don't forget to refcount it (see irlap_driver_rcv()) */ |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 85372cfa7b9f..e0b2b0d9af14 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -96,8 +96,8 @@ int __init irttp_init(void) | |||
96 | 96 | ||
97 | irttp->tsaps = hashbin_new(HB_LOCK); | 97 | irttp->tsaps = hashbin_new(HB_LOCK); |
98 | if (!irttp->tsaps) { | 98 | if (!irttp->tsaps) { |
99 | IRDA_ERROR("%s: can't allocate IrTTP hashbin!\n", | 99 | net_err_ratelimited("%s: can't allocate IrTTP hashbin!\n", |
100 | __func__); | 100 | __func__); |
101 | kfree(irttp); | 101 | kfree(irttp); |
102 | return -ENOMEM; | 102 | return -ENOMEM; |
103 | } | 103 | } |
@@ -518,8 +518,8 @@ int irttp_close_tsap(struct tsap_cb *self) | |||
518 | if (self->connected) { | 518 | if (self->connected) { |
519 | /* Check if disconnect is not pending */ | 519 | /* Check if disconnect is not pending */ |
520 | if (!test_bit(0, &self->disconnect_pend)) { | 520 | if (!test_bit(0, &self->disconnect_pend)) { |
521 | IRDA_WARNING("%s: TSAP still connected!\n", | 521 | net_warn_ratelimited("%s: TSAP still connected!\n", |
522 | __func__); | 522 | __func__); |
523 | irttp_disconnect_request(self, NULL, P_NORMAL); | 523 | irttp_disconnect_request(self, NULL, P_NORMAL); |
524 | } | 524 | } |
525 | self->close_pend = TRUE; | 525 | self->close_pend = TRUE; |
@@ -568,13 +568,14 @@ int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) | |||
568 | 568 | ||
569 | /* Check that nothing bad happens */ | 569 | /* Check that nothing bad happens */ |
570 | if (!self->connected) { | 570 | if (!self->connected) { |
571 | IRDA_WARNING("%s(), Not connected\n", __func__); | 571 | net_warn_ratelimited("%s(), Not connected\n", __func__); |
572 | ret = -ENOTCONN; | 572 | ret = -ENOTCONN; |
573 | goto err; | 573 | goto err; |
574 | } | 574 | } |
575 | 575 | ||
576 | if (skb->len > self->max_seg_size) { | 576 | if (skb->len > self->max_seg_size) { |
577 | IRDA_ERROR("%s(), UData is too large for IrLAP!\n", __func__); | 577 | net_err_ratelimited("%s(), UData is too large for IrLAP!\n", |
578 | __func__); | ||
578 | ret = -EMSGSIZE; | 579 | ret = -EMSGSIZE; |
579 | goto err; | 580 | goto err; |
580 | } | 581 | } |
@@ -617,7 +618,7 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) | |||
617 | 618 | ||
618 | /* Check that nothing bad happens */ | 619 | /* Check that nothing bad happens */ |
619 | if (!self->connected) { | 620 | if (!self->connected) { |
620 | IRDA_WARNING("%s: Not connected\n", __func__); | 621 | net_warn_ratelimited("%s: Not connected\n", __func__); |
621 | ret = -ENOTCONN; | 622 | ret = -ENOTCONN; |
622 | goto err; | 623 | goto err; |
623 | } | 624 | } |
@@ -627,8 +628,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) | |||
627 | * inside an IrLAP frame | 628 | * inside an IrLAP frame |
628 | */ | 629 | */ |
629 | if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) { | 630 | if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) { |
630 | IRDA_ERROR("%s: SAR disabled, and data is too large for IrLAP!\n", | 631 | net_err_ratelimited("%s: SAR disabled, and data is too large for IrLAP!\n", |
631 | __func__); | 632 | __func__); |
632 | ret = -EMSGSIZE; | 633 | ret = -EMSGSIZE; |
633 | goto err; | 634 | goto err; |
634 | } | 635 | } |
@@ -640,8 +641,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) | |||
640 | if ((self->tx_max_sdu_size != 0) && | 641 | if ((self->tx_max_sdu_size != 0) && |
641 | (self->tx_max_sdu_size != TTP_SAR_UNBOUND) && | 642 | (self->tx_max_sdu_size != TTP_SAR_UNBOUND) && |
642 | (skb->len > self->tx_max_sdu_size)) { | 643 | (skb->len > self->tx_max_sdu_size)) { |
643 | IRDA_ERROR("%s: SAR enabled, but data is larger than TxMaxSduSize!\n", | 644 | net_err_ratelimited("%s: SAR enabled, but data is larger than TxMaxSduSize!\n", |
644 | __func__); | 645 | __func__); |
645 | ret = -EMSGSIZE; | 646 | ret = -EMSGSIZE; |
646 | goto err; | 647 | goto err; |
647 | } | 648 | } |
@@ -1249,8 +1250,8 @@ static void irttp_connect_confirm(void *instance, void *sap, | |||
1249 | 1250 | ||
1250 | /* Any errors in the parameter list? */ | 1251 | /* Any errors in the parameter list? */ |
1251 | if (ret < 0) { | 1252 | if (ret < 0) { |
1252 | IRDA_WARNING("%s: error extracting parameters\n", | 1253 | net_warn_ratelimited("%s: error extracting parameters\n", |
1253 | __func__); | 1254 | __func__); |
1254 | dev_kfree_skb(skb); | 1255 | dev_kfree_skb(skb); |
1255 | 1256 | ||
1256 | /* Do not accept this connection attempt */ | 1257 | /* Do not accept this connection attempt */ |
@@ -1326,8 +1327,8 @@ static void irttp_connect_indication(void *instance, void *sap, | |||
1326 | 1327 | ||
1327 | /* Any errors in the parameter list? */ | 1328 | /* Any errors in the parameter list? */ |
1328 | if (ret < 0) { | 1329 | if (ret < 0) { |
1329 | IRDA_WARNING("%s: error extracting parameters\n", | 1330 | net_warn_ratelimited("%s: error extracting parameters\n", |
1330 | __func__); | 1331 | __func__); |
1331 | dev_kfree_skb(skb); | 1332 | dev_kfree_skb(skb); |
1332 | 1333 | ||
1333 | /* Do not accept this connection attempt */ | 1334 | /* Do not accept this connection attempt */ |
diff --git a/net/irda/parameters.c b/net/irda/parameters.c index 6d0869716bf6..d7a5778262ef 100644 --- a/net/irda/parameters.c +++ b/net/irda/parameters.c | |||
@@ -158,8 +158,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
158 | } | 158 | } |
159 | /* Check if buffer is long enough for insertion */ | 159 | /* Check if buffer is long enough for insertion */ |
160 | if (len < (2+p.pl)) { | 160 | if (len < (2+p.pl)) { |
161 | IRDA_WARNING("%s: buffer too short for insertion!\n", | 161 | net_warn_ratelimited("%s: buffer too short for insertion!\n", |
162 | __func__); | 162 | __func__); |
163 | return -1; | 163 | return -1; |
164 | } | 164 | } |
165 | IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __func__, | 165 | IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __func__, |
@@ -184,8 +184,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
184 | 184 | ||
185 | break; | 185 | break; |
186 | default: | 186 | default: |
187 | IRDA_WARNING("%s: length %d not supported\n", | 187 | net_warn_ratelimited("%s: length %d not supported\n", |
188 | __func__, p.pl); | 188 | __func__, p.pl); |
189 | /* Skip parameter */ | 189 | /* Skip parameter */ |
190 | return -1; | 190 | return -1; |
191 | } | 191 | } |
@@ -214,9 +214,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
214 | 214 | ||
215 | /* Check if buffer is long enough for parsing */ | 215 | /* Check if buffer is long enough for parsing */ |
216 | if (len < (2+p.pl)) { | 216 | if (len < (2+p.pl)) { |
217 | IRDA_WARNING("%s: buffer too short for parsing! " | 217 | net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n", |
218 | "Need %d bytes, but len is only %d\n", | 218 | __func__, p.pl, len); |
219 | __func__, p.pl, len); | ||
220 | return -1; | 219 | return -1; |
221 | } | 220 | } |
222 | 221 | ||
@@ -226,9 +225,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
226 | * PV_INTEGER means that the handler is flexible. | 225 | * PV_INTEGER means that the handler is flexible. |
227 | */ | 226 | */ |
228 | if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) { | 227 | if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) { |
229 | IRDA_ERROR("%s: invalid parameter length! " | 228 | net_err_ratelimited("%s: invalid parameter length! Expected %d bytes, but value had %d bytes!\n", |
230 | "Expected %d bytes, but value had %d bytes!\n", | 229 | __func__, type & PV_MASK, p.pl); |
231 | __func__, type & PV_MASK, p.pl); | ||
232 | 230 | ||
233 | /* Most parameters are bit/byte fields or little endian, | 231 | /* Most parameters are bit/byte fields or little endian, |
234 | * so it's ok to only extract a subset of it (the subset | 232 | * so it's ok to only extract a subset of it (the subset |
@@ -265,8 +263,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
265 | le32_to_cpus(&p.pv.i); | 263 | le32_to_cpus(&p.pv.i); |
266 | break; | 264 | break; |
267 | default: | 265 | default: |
268 | IRDA_WARNING("%s: length %d not supported\n", | 266 | net_warn_ratelimited("%s: length %d not supported\n", |
269 | __func__, p.pl); | 267 | __func__, p.pl); |
270 | 268 | ||
271 | /* Skip parameter */ | 269 | /* Skip parameter */ |
272 | return p.pl+2; | 270 | return p.pl+2; |
@@ -304,9 +302,8 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, | |||
304 | 302 | ||
305 | /* Check if buffer is long enough for parsing */ | 303 | /* Check if buffer is long enough for parsing */ |
306 | if (len < (2+p.pl)) { | 304 | if (len < (2+p.pl)) { |
307 | IRDA_WARNING("%s: buffer too short for parsing! " | 305 | net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n", |
308 | "Need %d bytes, but len is only %d\n", | 306 | __func__, p.pl, len); |
309 | __func__, p.pl, len); | ||
310 | return -1; | 307 | return -1; |
311 | } | 308 | } |
312 | 309 | ||
@@ -343,9 +340,8 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi, | |||
343 | 340 | ||
344 | /* Check if buffer is long enough for parsing */ | 341 | /* Check if buffer is long enough for parsing */ |
345 | if (len < (2+p.pl)) { | 342 | if (len < (2+p.pl)) { |
346 | IRDA_WARNING("%s: buffer too short for parsing! " | 343 | net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n", |
347 | "Need %d bytes, but len is only %d\n", | 344 | __func__, p.pl, len); |
348 | __func__, p.pl, len); | ||
349 | return -1; | 345 | return -1; |
350 | } | 346 | } |
351 | 347 | ||
@@ -487,7 +483,8 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, | |||
487 | 483 | ||
488 | /* Check if handler has been implemented */ | 484 | /* Check if handler has been implemented */ |
489 | if (!pi_minor_info->func) { | 485 | if (!pi_minor_info->func) { |
490 | IRDA_MESSAGE("%s: no handler for pi=%#x\n", __func__, pi); | 486 | net_info_ratelimited("%s: no handler for pi=%#x\n", |
487 | __func__, pi); | ||
491 | /* Skip this parameter */ | 488 | /* Skip this parameter */ |
492 | return -1; | 489 | return -1; |
493 | } | 490 | } |
@@ -544,8 +541,8 @@ static int irda_param_extract(void *self, __u8 *buf, int len, | |||
544 | 541 | ||
545 | /* Check if handler has been implemented */ | 542 | /* Check if handler has been implemented */ |
546 | if (!pi_minor_info->func) { | 543 | if (!pi_minor_info->func) { |
547 | IRDA_MESSAGE("%s: no handler for pi=%#x\n", | 544 | net_info_ratelimited("%s: no handler for pi=%#x\n", |
548 | __func__, buf[n]); | 545 | __func__, buf[n]); |
549 | /* Skip this parameter */ | 546 | /* Skip this parameter */ |
550 | return 2 + buf[n + 1]; /* Continue */ | 547 | return 2 + buf[n + 1]; /* Continue */ |
551 | } | 548 | } |
diff --git a/net/irda/qos.c b/net/irda/qos.c index 11a7cc0cbc28..f3b588c17d3b 100644 --- a/net/irda/qos.c +++ b/net/irda/qos.c | |||
@@ -200,8 +200,8 @@ static int msb_index (__u16 word) | |||
200 | * able to check precisely what's going on. If a end user sees this, | 200 | * able to check precisely what's going on. If a end user sees this, |
201 | * it's very likely the peer. - Jean II */ | 201 | * it's very likely the peer. - Jean II */ |
202 | if (word == 0) { | 202 | if (word == 0) { |
203 | IRDA_WARNING("%s(), Detected buggy peer, adjust null PV to 0x1!\n", | 203 | net_warn_ratelimited("%s(), Detected buggy peer, adjust null PV to 0x1!\n", |
204 | __func__); | 204 | __func__); |
205 | /* The only safe choice (we don't know the array size) */ | 205 | /* The only safe choice (we don't know the array size) */ |
206 | word = 0x1; | 206 | word = 0x1; |
207 | } | 207 | } |
@@ -351,8 +351,8 @@ static void irlap_adjust_qos_settings(struct qos_info *qos) | |||
351 | if (sysctl_min_tx_turn_time > qos->min_turn_time.value) { | 351 | if (sysctl_min_tx_turn_time > qos->min_turn_time.value) { |
352 | int i; | 352 | int i; |
353 | 353 | ||
354 | IRDA_WARNING("%s(), Detected buggy peer, adjust mtt to %dus!\n", | 354 | net_warn_ratelimited("%s(), Detected buggy peer, adjust mtt to %dus!\n", |
355 | __func__, sysctl_min_tx_turn_time); | 355 | __func__, sysctl_min_tx_turn_time); |
356 | 356 | ||
357 | /* We don't really need bits, but easier this way */ | 357 | /* We don't really need bits, but easier this way */ |
358 | i = value_highest_bit(sysctl_min_tx_turn_time, min_turn_times, | 358 | i = value_highest_bit(sysctl_min_tx_turn_time, min_turn_times, |
@@ -402,8 +402,8 @@ static void irlap_adjust_qos_settings(struct qos_info *qos) | |||
402 | IRDA_DEBUG(2, "%s(), reducing data size to %d\n", | 402 | IRDA_DEBUG(2, "%s(), reducing data size to %d\n", |
403 | __func__, qos->data_size.value); | 403 | __func__, qos->data_size.value); |
404 | } else { | 404 | } else { |
405 | IRDA_WARNING("%s(), nothing more we can do!\n", | 405 | net_warn_ratelimited("%s(), nothing more we can do!\n", |
406 | __func__); | 406 | __func__); |
407 | } | 407 | } |
408 | } | 408 | } |
409 | #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ | 409 | #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ |
diff --git a/net/irda/wrapper.c b/net/irda/wrapper.c index fd0995b1323a..9efffeb8d0f1 100644 --- a/net/irda/wrapper.c +++ b/net/irda/wrapper.c | |||
@@ -134,8 +134,8 @@ int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize) | |||
134 | * transmitted after this point is 5. | 134 | * transmitted after this point is 5. |
135 | */ | 135 | */ |
136 | if(n >= (buffsize-5)) { | 136 | if(n >= (buffsize-5)) { |
137 | IRDA_ERROR("%s(), tx buffer overflow (n=%d)\n", | 137 | net_err_ratelimited("%s(), tx buffer overflow (n=%d)\n", |
138 | __func__, n); | 138 | __func__, n); |
139 | return n; | 139 | return n; |
140 | } | 140 | } |
141 | 141 | ||
@@ -386,7 +386,7 @@ async_unwrap_ce(struct net_device *dev, | |||
386 | break; | 386 | break; |
387 | 387 | ||
388 | case LINK_ESCAPE: | 388 | case LINK_ESCAPE: |
389 | IRDA_WARNING("%s: state not defined\n", __func__); | 389 | net_warn_ratelimited("%s: state not defined\n", __func__); |
390 | break; | 390 | break; |
391 | 391 | ||
392 | case BEGIN_FRAME: | 392 | case BEGIN_FRAME: |