From b025362a7a1acf27991c4729d4a730ff8722b165 Mon Sep 17 00:00:00 2001
From: Koen Zandberg <koen@bergzand.net>
Date: Fri, 20 Jul 2018 12:07:08 +0200
Subject: [PATCH] at86rf2xx: Always set channel on device

This removes the check if the current configured channel equals the new
channel. This check prevents the at86rf2xx channel to be configured
after a reset which causes the radio to be non-functional after a
NETOPT_STATE_RESET.
---
 drivers/at86rf2xx/at86rf2xx_getset.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/at86rf2xx/at86rf2xx_getset.c b/drivers/at86rf2xx/at86rf2xx_getset.c
index 6072b2d552..a4928d89c4 100644
--- a/drivers/at86rf2xx/at86rf2xx_getset.c
+++ b/drivers/at86rf2xx/at86rf2xx_getset.c
@@ -140,11 +140,11 @@ uint8_t at86rf2xx_get_chan(const at86rf2xx_t *dev)
 
 void at86rf2xx_set_chan(at86rf2xx_t *dev, uint8_t channel)
 {
-    if ((channel > AT86RF2XX_MAX_CHANNEL) ||
+    if ((channel > AT86RF2XX_MAX_CHANNEL)
 #if AT86RF2XX_MIN_CHANNEL /* is zero for sub-GHz */
-        (channel < AT86RF2XX_MIN_CHANNEL) ||
+       || (channel < AT86RF2XX_MIN_CHANNEL)
 #endif
-        (dev->netdev.chan == channel)) {
+        ) {
         return;
     }
 
-- 
GitLab