at86rf230: move RX_SAFE_MODE setting to hw_init
authorAlexander Aring <alex.aring@gmail.com>
Wed, 2 Jul 2014 22:20:49 +0000 (00:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jul 2014 04:29:25 +0000 (21:29 -0700)
There is no need to set this bit in start callback which could be
called more than once.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ieee802154/at86rf230.c

index 39c3c117340df931cb2a41e642b0efe433ae3c8e..492fb7e7675d56415e9a31557903f62591f85ba6 100644 (file)
@@ -1010,13 +1010,8 @@ err:
 static int
 at86rf230_start(struct ieee802154_dev *dev)
 {
-       struct at86rf230_local *lp = dev->priv;
        u8 rc;
 
-       rc = at86rf230_write_subreg(lp, SR_RX_SAFE_MODE, 1);
-       if (rc)
-               return rc;
-
        rc = at86rf230_state(dev, STATE_TX_ON);
        if (rc)
                return rc;
@@ -1300,6 +1295,10 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
        if (rc)
                return rc;
 
+       rc = at86rf230_write_subreg(lp, SR_RX_SAFE_MODE, 1);
+       if (rc)
+               return rc;
+
        rc = at86rf230_write_subreg(lp, SR_IRQ_MASK, IRQ_TRX_END);
        if (rc)
                return rc;