diff options
author | Thomas Pugliese <thomas.pugliese@gmail.com> | 2014-04-25 19:30:33 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-28 01:56:54 +0400 |
commit | 7b360ee09a8bec5783cbecdcb17cd8d70edadf56 (patch) | |
tree | 1f0e15c0e2e5e5c7b3ce1ce6fbebe5f1bde7b24c /drivers/uwb/rsv.c | |
parent | 90ec00d54e28f4b038e66905ea5b9478bcdc3f37 (diff) | |
download | linux-7b360ee09a8bec5783cbecdcb17cd8d70edadf56.tar.xz |
uwb: add error messages when reservation establish fails
Add better error messages during the channel change/reservation establish
process.
Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uwb/rsv.c')
-rw-r--r-- | drivers/uwb/rsv.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/uwb/rsv.c b/drivers/uwb/rsv.c index 4026f1adff01..0887ae982783 100644 --- a/drivers/uwb/rsv.c +++ b/drivers/uwb/rsv.c @@ -163,8 +163,10 @@ static int uwb_rsv_get_stream(struct uwb_rsv *rsv) } stream = find_first_zero_bit(streams_bm, UWB_NUM_STREAMS); - if (stream >= UWB_NUM_STREAMS) + if (stream >= UWB_NUM_STREAMS) { + dev_err(dev, "%s: no available stream found\n", __func__); return -EBUSY; + } rsv->stream = stream; set_bit(stream, streams_bm); @@ -555,12 +557,16 @@ int uwb_rsv_establish(struct uwb_rsv *rsv) { struct uwb_rc *rc = rsv->rc; struct uwb_mas_bm available; + struct device *dev = &rc->uwb_dev.dev; int ret; mutex_lock(&rc->rsvs_mutex); ret = uwb_rsv_get_stream(rsv); - if (ret) + if (ret) { + dev_err(dev, "%s: uwb_rsv_get_stream failed: %d\n", + __func__, ret); goto out; + } rsv->tiebreaker = prandom_u32() & 1; /* get available mas bitmap */ @@ -570,12 +576,16 @@ int uwb_rsv_establish(struct uwb_rsv *rsv) if (ret == UWB_RSV_ALLOC_NOT_FOUND) { ret = -EBUSY; uwb_rsv_put_stream(rsv); + dev_err(dev, "%s: uwb_rsv_find_best_allocation failed: %d\n", + __func__, ret); goto out; } ret = uwb_drp_avail_reserve_pending(rc, &rsv->mas); if (ret != 0) { uwb_rsv_put_stream(rsv); + dev_err(dev, "%s: uwb_drp_avail_reserve_pending failed: %d\n", + __func__, ret); goto out; } |