aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ieee802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-10-07 04:38:26 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-10-25 01:56:22 -0400
commitd06c21990fbbca644a31a3c851c22a8d1f5d0e66 (patch)
tree4ac719d02f7f0c6d9588247752add29a3bf19da3 /drivers/net/ieee802154
parent464f029915de6379c8fcd18d5dd49e5b3d1a2cc5 (diff)
at86rf230: add missing error handling
This patch adds an async error handling function if sync state change runs into a timeout. The async error handling function tries to recover the phy state machine into a valid state. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net/ieee802154')
-rw-r--r--drivers/net/ieee802154/at86rf230.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 6857038111a0..44d2f1de31e0 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -690,8 +690,10 @@ at86rf230_sync_state_change(struct at86rf230_local *lp, unsigned int state)
690 690
691 rc = wait_for_completion_timeout(&lp->state_complete, 691 rc = wait_for_completion_timeout(&lp->state_complete,
692 msecs_to_jiffies(100)); 692 msecs_to_jiffies(100));
693 if (!rc) 693 if (!rc) {
694 at86rf230_async_error(lp, &lp->state, -ETIMEDOUT);
694 return -ETIMEDOUT; 695 return -ETIMEDOUT;
696 }
695 697
696 return 0; 698 return 0;
697} 699}