Thread (1 message) 1 message, 1 author, 2014-07-02
DORMANTno replies

[PATCH v2 net-next 07/13] at86rf230: move RX_SAFE_MODE setting to hw_init

From: Alexander Aring <hidden>
Date: 2014-07-02 15:10:04
Subsystem: ieee 802.15.4 subsystem, networking drivers, the rest · Maintainers: Alexander Aring, Stefan Schmidt, Miquel Raynal, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

There is no need to set this bit in start callback which could be
called more than once.

Signed-off-by: Alexander Aring <redacted>
---
 drivers/net/ieee802154/at86rf230.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 39c3c11..492fb7e 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -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;
-- 
2.0.1


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help