Skip to content

Commit

Permalink
ieee802154: cc2520: Fix error return code in cc2520_hw_init()
Browse files Browse the repository at this point in the history
[ Upstream commit 4d002d6 ]

In cc2520_hw_init(), if oscillator start failed, the error code
should be returned.

Fixes: 0da6bc8 ("ieee802154: cc2520: adds driver for TI CC2520 radio")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Link: https://lore.kernel.org/r/20221120075046.2213633-1-william.xuanziyang@huawei.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Ziyang Xuan authored and gregkh committed Dec 14, 2022
1 parent dd9dcfb commit 80dad8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ieee802154/cc2520.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ static int cc2520_hw_init(struct cc2520_private *priv)

if (timeout-- <= 0) {
dev_err(&priv->spi->dev, "oscillator start failed!\n");
return ret;
return -ETIMEDOUT;
}
udelay(1);
} while (!(status & CC2520_STATUS_XOSC32M_STABLE));
Expand Down

0 comments on commit 80dad8d

Please sign in to comment.