Skip to content

Commit

Permalink
at86rf230: move RX_SAFE_MODE setting to hw_init
Browse files Browse the repository at this point in the history
There is no need to set this bit in start callback which could be
called more than once.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
alexaring authored and davem330 committed Jul 8, 2014
1 parent 1d15d6b commit 6bd2b13
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/net/ieee802154/at86rf230.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,13 +1010,8 @@ at86rf230_state(struct ieee802154_dev *dev, int state)
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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6bd2b13

Please sign in to comment.