From: Alexander Aring Date: Tue, 17 Mar 2015 09:32:39 +0000 (+0100) Subject: at86rf230: fix at86rf230_read_subreg succeed handling X-Git-Tag: v5.15~15978^2~69^2~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d907c4f05cc7cb18d0f41f23cadf7f8ec10bfd29;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index b64c5c7..cc5efa1 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -325,7 +325,7 @@ at86rf230_read_subreg(struct at86rf230_local *lp, int rc; rc = __at86rf230_read(lp, addr, data); - if (rc > 0) + if (!rc) *data = (*data & mask) >> shift; return rc;