aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-03-17 05:32:39 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-03-17 11:30:57 -0400
commitd907c4f05cc7cb18d0f41f23cadf7f8ec10bfd29 (patch)
treec1cdf66d8d336f1717c191b2566586b330f4def0 /drivers/net
parentc9e44474f27e251fcdc1b52d7bd0a7607af4473a (diff)
at86rf230: fix at86rf230_read_subreg succeed handling
This patch fix an issue when at86rf230_read_subreg was successful. The function at86rf230_read_subreg will directly call regmap_read which returns zero on successful. Nobody figured out issues yet because it was only necessary to evaluate dvdd state while probing. This could make trouble because the stack variable could have an random value. The function is also used by reset the irq line before requesting irq, but the value isn't evaluated afterwards. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ieee802154/at86rf230.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index b64c5c7b2a50..cc5efa149da1 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -325,7 +325,7 @@ at86rf230_read_subreg(struct at86rf230_local *lp,
325 int rc; 325 int rc;
326 326
327 rc = __at86rf230_read(lp, addr, data); 327 rc = __at86rf230_read(lp, addr, data);
328 if (rc > 0) 328 if (!rc)
329 *data = (*data & mask) >> shift; 329 *data = (*data & mask) >> shift;
330 330
331 return rc; 331 return rc;