Skip to content

Commit 1cc9fc5

Browse files
alexaringdavem330
authored andcommitted
at86rf230: remove unnecessary state read
This patch removes a unnecessary state read. The status value is never evaluate after reading the state. Also rename the status variable to dvdd, because this variable will be used later. Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 57e48ff commit 1cc9fc5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/net/ieee802154/at86rf230.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -969,13 +969,9 @@ static int at86rf230_irq_polarity(struct at86rf230_local *lp, int pol)
969969
static int at86rf230_hw_init(struct at86rf230_local *lp)
970970
{
971971
int rc, irq_pol, irq_type;
972-
u8 status;
972+
u8 dvdd;
973973
u8 csma_seed[2];
974974

975-
rc = at86rf230_read_subreg(lp, SR_TRX_STATUS, &status);
976-
if (rc)
977-
return rc;
978-
979975
rc = at86rf230_write_subreg(lp, SR_TRX_CMD, STATE_FORCE_TRX_OFF);
980976
if (rc)
981977
return rc;
@@ -1015,10 +1011,10 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
10151011
/* Wait the next SLEEP cycle */
10161012
msleep(100);
10171013

1018-
rc = at86rf230_read_subreg(lp, SR_DVDD_OK, &status);
1014+
rc = at86rf230_read_subreg(lp, SR_DVDD_OK, &dvdd);
10191015
if (rc)
10201016
return rc;
1021-
if (!status) {
1017+
if (!dvdd) {
10221018
dev_err(&lp->spi->dev, "DVDD error\n");
10231019
return -EINVAL;
10241020
}

0 commit comments

Comments
 (0)