diff options
author | David Vrabel <dv02@dv02pc01.europe.root.pri> | 2008-10-16 08:56:53 -0400 |
---|---|---|
committer | David Vrabel <dv02@dv02pc01.europe.root.pri> | 2008-10-16 08:56:53 -0400 |
commit | 8092d7c9789581eea478c40d615a2632c3af17bb (patch) | |
tree | a9fccedfcdbfd9a74220aa99d48fa8a003313deb /drivers/uwb | |
parent | 92c4d9bd1648b3eaca6b8b8f8932eec390ba7327 (diff) |
uwb: don't use printk_ratelimit() so often
Avoid using printk_ratelimit() in many places because:
- many were error messages reporting broken hardware (it's useful to
get all of these).
- the message itself wasn't useful so the message has been removed.
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/uwb')
-rw-r--r-- | drivers/uwb/beacon.c | 9 | ||||
-rw-r--r-- | drivers/uwb/est.c | 38 | ||||
-rw-r--r-- | drivers/uwb/i1480/dfu/mac.c | 4 | ||||
-rw-r--r-- | drivers/uwb/neh.c | 2 | ||||
-rw-r--r-- | drivers/uwb/uwbd.c | 29 | ||||
-rw-r--r-- | drivers/uwb/whc-rc.c | 8 |
6 files changed, 26 insertions, 64 deletions
diff --git a/drivers/uwb/beacon.c b/drivers/uwb/beacon.c index 1ccf9eb3e086..c7f3c972f07d 100644 --- a/drivers/uwb/beacon.c +++ b/drivers/uwb/beacon.c | |||
@@ -410,7 +410,6 @@ int uwbd_evt_handle_rc_beacon(struct uwb_event *evt) | |||
410 | struct uwb_rc_evt_beacon *be; | 410 | struct uwb_rc_evt_beacon *be; |
411 | struct uwb_beacon_frame *bf; | 411 | struct uwb_beacon_frame *bf; |
412 | struct uwb_beca_e *bce; | 412 | struct uwb_beca_e *bce; |
413 | struct device *dev = &evt->rc->uwb_dev.dev; | ||
414 | unsigned long last_ts; | 413 | unsigned long last_ts; |
415 | 414 | ||
416 | rc = evt->rc; | 415 | rc = evt->rc; |
@@ -419,14 +418,12 @@ int uwbd_evt_handle_rc_beacon(struct uwb_event *evt) | |||
419 | if (result < 0) | 418 | if (result < 0) |
420 | return result; | 419 | return result; |
421 | 420 | ||
422 | /* Ignore beacon if it is from an alien. */ | 421 | /* FIXME: handle alien beacons. */ |
423 | if (be->bBeaconType == UWB_RC_BEACON_TYPE_OL_ALIEN || | 422 | if (be->bBeaconType == UWB_RC_BEACON_TYPE_OL_ALIEN || |
424 | be->bBeaconType == UWB_RC_BEACON_TYPE_NOL_ALIEN) { | 423 | be->bBeaconType == UWB_RC_BEACON_TYPE_NOL_ALIEN) { |
425 | if (printk_ratelimit()) | 424 | return -ENOSYS; |
426 | dev_err(dev, "BEACON received from ALIEN. Action? \n"); | ||
427 | result = -ENOSYS; | ||
428 | return 0; | ||
429 | } | 425 | } |
426 | |||
430 | bf = (struct uwb_beacon_frame *) be->BeaconInfo; | 427 | bf = (struct uwb_beacon_frame *) be->BeaconInfo; |
431 | 428 | ||
432 | /* | 429 | /* |
diff --git a/drivers/uwb/est.c b/drivers/uwb/est.c index 3791cd95b63d..5fe566b7c845 100644 --- a/drivers/uwb/est.c +++ b/drivers/uwb/est.c | |||
@@ -363,22 +363,17 @@ ssize_t uwb_est_get_size(struct uwb_rc *uwb_rc, struct uwb_est *est, | |||
363 | 363 | ||
364 | size = -ENOENT; | 364 | size = -ENOENT; |
365 | if (event_low >= est->entries) { /* in range? */ | 365 | if (event_low >= est->entries) { /* in range? */ |
366 | if (printk_ratelimit()) | 366 | dev_err(dev, "EST %p 0x%04x/%04x/%04x[%u]: event %u out of range\n", |
367 | dev_err(dev, "EST %p 0x%04x/%04x/%04x[%u]: " | 367 | est, est->type_event_high, est->vendor, est->product, |
368 | "event %u out of range\n", | 368 | est->entries, event_low); |
369 | est, est->type_event_high, est->vendor, | ||
370 | est->product, est->entries, | ||
371 | event_low); | ||
372 | goto out; | 369 | goto out; |
373 | } | 370 | } |
374 | size = -ENOENT; | 371 | size = -ENOENT; |
375 | entry = &est->entry[event_low]; | 372 | entry = &est->entry[event_low]; |
376 | if (entry->size == 0 && entry->offset == 0) { /* unknown? */ | 373 | if (entry->size == 0 && entry->offset == 0) { /* unknown? */ |
377 | if (printk_ratelimit()) | 374 | dev_err(dev, "EST %p 0x%04x/%04x/%04x[%u]: event %u unknown\n", |
378 | dev_err(dev, "EST %p 0x%04x/%04x/%04x[%u]: " | 375 | est, est->type_event_high, est->vendor, est->product, |
379 | "event %u unknown\n", | 376 | est->entries, event_low); |
380 | est, est->type_event_high, est->vendor, | ||
381 | est->product, est->entries, event_low); | ||
382 | goto out; | 377 | goto out; |
383 | } | 378 | } |
384 | offset = entry->offset; /* extra fries with that? */ | 379 | offset = entry->offset; /* extra fries with that? */ |
@@ -396,11 +391,10 @@ ssize_t uwb_est_get_size(struct uwb_rc *uwb_rc, struct uwb_est *est, | |||
396 | default: BUG(); | 391 | default: BUG(); |
397 | } | 392 | } |
398 | if (offset + type_size > rceb_size) { | 393 | if (offset + type_size > rceb_size) { |
399 | if (printk_ratelimit()) | 394 | dev_err(dev, "EST %p 0x%04x/%04x/%04x[%u]: " |
400 | dev_err(dev, "EST %p 0x%04x/%04x/%04x[%u]: " | 395 | "not enough data to read extra size\n", |
401 | "not enough data to read extra size\n", | 396 | est, est->type_event_high, est->vendor, |
402 | est, est->type_event_high, est->vendor, | 397 | est->product, est->entries); |
403 | est->product, est->entries); | ||
404 | goto out; | 398 | goto out; |
405 | } | 399 | } |
406 | size = entry->size; | 400 | size = entry->size; |
@@ -469,14 +463,12 @@ ssize_t uwb_est_find_size(struct uwb_rc *rc, const struct uwb_rceb *rceb, | |||
469 | if (size != -ENOENT) | 463 | if (size != -ENOENT) |
470 | goto out; | 464 | goto out; |
471 | } | 465 | } |
472 | /* FIXME: downgrade to _dbg() */ | 466 | dev_dbg(dev, "event 0x%02x/%04x/%02x: no handlers available; " |
473 | if (printk_ratelimit()) | ||
474 | dev_err(dev, "event 0x%02x/%04x/%02x: no handlers available; " | ||
475 | "RCEB %02x %02x %02x %02x\n", | 467 | "RCEB %02x %02x %02x %02x\n", |
476 | (unsigned) rceb->bEventType, | 468 | (unsigned) rceb->bEventType, |
477 | (unsigned) le16_to_cpu(rceb->wEvent), | 469 | (unsigned) le16_to_cpu(rceb->wEvent), |
478 | (unsigned) rceb->bEventContext, | 470 | (unsigned) rceb->bEventContext, |
479 | ptr[0], ptr[1], ptr[2], ptr[3]); | 471 | ptr[0], ptr[1], ptr[2], ptr[3]); |
480 | size = -ENOENT; | 472 | size = -ENOENT; |
481 | out: | 473 | out: |
482 | read_unlock_irqrestore(&uwb_est_lock, flags); | 474 | read_unlock_irqrestore(&uwb_est_lock, flags); |
diff --git a/drivers/uwb/i1480/dfu/mac.c b/drivers/uwb/i1480/dfu/mac.c index 8d069907a3b5..2e4d8f07c165 100644 --- a/drivers/uwb/i1480/dfu/mac.c +++ b/drivers/uwb/i1480/dfu/mac.c | |||
@@ -425,7 +425,7 @@ out: | |||
425 | } | 425 | } |
426 | 426 | ||
427 | 427 | ||
428 | /** Wait for the MAC FW to start running */ | 428 | /* Wait for the MAC FW to start running */ |
429 | static | 429 | static |
430 | int i1480_fw_is_running_q(struct i1480 *i1480) | 430 | int i1480_fw_is_running_q(struct i1480 *i1480) |
431 | { | 431 | { |
@@ -443,8 +443,6 @@ int i1480_fw_is_running_q(struct i1480 *i1480) | |||
443 | } | 443 | } |
444 | if (*val == 0x55555555UL) /* fw running? cool */ | 444 | if (*val == 0x55555555UL) /* fw running? cool */ |
445 | goto out; | 445 | goto out; |
446 | if (printk_ratelimit()) | ||
447 | d_printf(5, i1480->dev, "read #%d: 0x%08x\n", cnt, *val); | ||
448 | } | 446 | } |
449 | dev_err(i1480->dev, "Timed out waiting for fw to start\n"); | 447 | dev_err(i1480->dev, "Timed out waiting for fw to start\n"); |
450 | result = -ETIMEDOUT; | 448 | result = -ETIMEDOUT; |
diff --git a/drivers/uwb/neh.c b/drivers/uwb/neh.c index 91b61480e1ee..9b4eb64327ac 100644 --- a/drivers/uwb/neh.c +++ b/drivers/uwb/neh.c | |||
@@ -440,7 +440,7 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size | |||
440 | neh = uwb_rc_neh_lookup(rc, rceb); | 440 | neh = uwb_rc_neh_lookup(rc, rceb); |
441 | if (neh) | 441 | if (neh) |
442 | uwb_rc_neh_cb(neh, rceb, size); | 442 | uwb_rc_neh_cb(neh, rceb, size); |
443 | else if (printk_ratelimit()) | 443 | else |
444 | dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n", | 444 | dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n", |
445 | rceb->bEventType, le16_to_cpu(rceb->wEvent), | 445 | rceb->bEventType, le16_to_cpu(rceb->wEvent), |
446 | rceb->bEventContext, size); | 446 | rceb->bEventContext, size); |
diff --git a/drivers/uwb/uwbd.c b/drivers/uwb/uwbd.c index b3673d614adb..78908416e42c 100644 --- a/drivers/uwb/uwbd.c +++ b/drivers/uwb/uwbd.c | |||
@@ -188,7 +188,6 @@ static DEFINE_MUTEX(uwbd_event_mutex); | |||
188 | static | 188 | static |
189 | int uwbd_event_handle_urc(struct uwb_event *evt) | 189 | int uwbd_event_handle_urc(struct uwb_event *evt) |
190 | { | 190 | { |
191 | int result; | ||
192 | struct uwbd_evt_type_handler *type_table; | 191 | struct uwbd_evt_type_handler *type_table; |
193 | uwbd_evt_handler_f handler; | 192 | uwbd_evt_handler_f handler; |
194 | u8 type, context; | 193 | u8 type, context; |
@@ -199,41 +198,25 @@ int uwbd_event_handle_urc(struct uwb_event *evt) | |||
199 | context = evt->notif.rceb->bEventContext; | 198 | context = evt->notif.rceb->bEventContext; |
200 | 199 | ||
201 | if (type > uwbd_evt_type_handlers_len) { | 200 | if (type > uwbd_evt_type_handlers_len) { |
202 | if (printk_ratelimit()) | 201 | printk(KERN_ERR "UWBD: event type %u: unknown (too high)\n", type); |
203 | printk(KERN_ERR "UWBD: event type %u: unknown " | ||
204 | "(too high)\n", type); | ||
205 | return -EINVAL; | 202 | return -EINVAL; |
206 | } | 203 | } |
207 | type_table = &uwbd_evt_type_handlers[type]; | 204 | type_table = &uwbd_evt_type_handlers[type]; |
208 | if (type_table->uwbd_events == NULL) { | 205 | if (type_table->uwbd_events == NULL) { |
209 | if (printk_ratelimit()) | 206 | printk(KERN_ERR "UWBD: event type %u: unknown\n", type); |
210 | printk(KERN_ERR "UWBD: event type %u: unknown\n", type); | ||
211 | return -EINVAL; | 207 | return -EINVAL; |
212 | } | 208 | } |
213 | if (event > type_table->size) { | 209 | if (event > type_table->size) { |
214 | if (printk_ratelimit()) | 210 | printk(KERN_ERR "UWBD: event %s[%u]: unknown (too high)\n", |
215 | printk(KERN_ERR "UWBD: event %s[%u]: " | 211 | type_table->name, event); |
216 | "unknown (too high)\n", type_table->name, event); | ||
217 | return -EINVAL; | 212 | return -EINVAL; |
218 | } | 213 | } |
219 | handler = type_table->uwbd_events[event].handler; | 214 | handler = type_table->uwbd_events[event].handler; |
220 | if (handler == NULL) { | 215 | if (handler == NULL) { |
221 | if (printk_ratelimit()) | 216 | printk(KERN_ERR "UWBD: event %s[%u]: unknown\n", type_table->name, event); |
222 | printk(KERN_ERR "UWBD: event %s[%u]: unknown\n", | ||
223 | type_table->name, event); | ||
224 | return -EINVAL; | 217 | return -EINVAL; |
225 | } | 218 | } |
226 | d_printf(3, NULL, "processing 0x%02x/%04x/%02x, %zu bytes\n", | 219 | return (*handler)(evt); |
227 | type, event, context, evt->notif.size); | ||
228 | result = (*handler)(evt); | ||
229 | if (result < 0) { | ||
230 | if (printk_ratelimit()) | ||
231 | printk(KERN_ERR "UWBD: event 0x%02x/%04x/%02x, " | ||
232 | "table %s[%u]: handling failed: %d\n", | ||
233 | type, event, context, type_table->name, | ||
234 | event, result); | ||
235 | } | ||
236 | return result; | ||
237 | } | 220 | } |
238 | 221 | ||
239 | static void uwbd_event_handle_message(struct uwb_event *evt) | 222 | static void uwbd_event_handle_message(struct uwb_event *evt) |
diff --git a/drivers/uwb/whc-rc.c b/drivers/uwb/whc-rc.c index 5a93abea6d23..1711deadb114 100644 --- a/drivers/uwb/whc-rc.c +++ b/drivers/uwb/whc-rc.c | |||
@@ -212,7 +212,6 @@ irqreturn_t whcrc_irq_cb(int irq, void *_whcrc) | |||
212 | struct device *dev = &whcrc->umc_dev->dev; | 212 | struct device *dev = &whcrc->umc_dev->dev; |
213 | u32 urcsts; | 213 | u32 urcsts; |
214 | 214 | ||
215 | d_fnstart(4, dev, "irq %d _whcrc %p)\n", irq, _whcrc); | ||
216 | urcsts = le_readl(whcrc->rc_base + URCSTS); | 215 | urcsts = le_readl(whcrc->rc_base + URCSTS); |
217 | if (!(urcsts & URCSTS_INT_MASK)) | 216 | if (!(urcsts & URCSTS_INT_MASK)) |
218 | return IRQ_NONE; | 217 | return IRQ_NONE; |
@@ -221,13 +220,6 @@ irqreturn_t whcrc_irq_cb(int irq, void *_whcrc) | |||
221 | d_printf(4, dev, "acked 0x%08x, urcsts 0x%08x\n", | 220 | d_printf(4, dev, "acked 0x%08x, urcsts 0x%08x\n", |
222 | le_readl(whcrc->rc_base + URCSTS), urcsts); | 221 | le_readl(whcrc->rc_base + URCSTS), urcsts); |
223 | 222 | ||
224 | if (whcrc->uwb_rc == NULL) { | ||
225 | if (printk_ratelimit()) | ||
226 | dev_dbg(dev, "Received interrupt when not yet " | ||
227 | "ready!\n"); | ||
228 | goto out; | ||
229 | } | ||
230 | |||
231 | if (urcsts & URCSTS_HSE) { | 223 | if (urcsts & URCSTS_HSE) { |
232 | dev_err(dev, "host system error -- hardware halted\n"); | 224 | dev_err(dev, "host system error -- hardware halted\n"); |
233 | /* FIXME: do something sensible here */ | 225 | /* FIXME: do something sensible here */ |