Commit 22e8860c authored by Kangjie Lu's avatar Kangjie Lu Committed by Stefan Schmidt

net: ieee802154: fix missing checks for regmap_update_bits

regmap_update_bits could fail and deserves a check.

The patch adds the checks and if it fails, returns its error
code upstream.
Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Reviewed-by: default avatarMukesh Ojha <mojha@codeaurora.org>
Signed-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
parent 1c5c12ee
...@@ -533,6 +533,8 @@ mcr20a_start(struct ieee802154_hw *hw) ...@@ -533,6 +533,8 @@ mcr20a_start(struct ieee802154_hw *hw)
dev_dbg(printdev(lp), "no slotted operation\n"); dev_dbg(printdev(lp), "no slotted operation\n");
ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1, ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1,
DAR_PHY_CTRL1_SLOTTED, 0x0); DAR_PHY_CTRL1_SLOTTED, 0x0);
if (ret < 0)
return ret;
/* enable irq */ /* enable irq */
enable_irq(lp->spi->irq); enable_irq(lp->spi->irq);
...@@ -540,11 +542,15 @@ mcr20a_start(struct ieee802154_hw *hw) ...@@ -540,11 +542,15 @@ mcr20a_start(struct ieee802154_hw *hw)
/* Unmask SEQ interrupt */ /* Unmask SEQ interrupt */
ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL2, ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL2,
DAR_PHY_CTRL2_SEQMSK, 0x0); DAR_PHY_CTRL2_SEQMSK, 0x0);
if (ret < 0)
return ret;
/* Start the RX sequence */ /* Start the RX sequence */
dev_dbg(printdev(lp), "start the RX sequence\n"); dev_dbg(printdev(lp), "start the RX sequence\n");
ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1, ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1,
DAR_PHY_CTRL1_XCVSEQ_MASK, MCR20A_XCVSEQ_RX); DAR_PHY_CTRL1_XCVSEQ_MASK, MCR20A_XCVSEQ_RX);
if (ret < 0)
return ret;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment