mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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 <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
57e48ffce9
commit
1cc9fc53b3
1 changed files with 3 additions and 7 deletions
|
@ -969,13 +969,9 @@ static int at86rf230_irq_polarity(struct at86rf230_local *lp, int pol)
|
||||||
static int at86rf230_hw_init(struct at86rf230_local *lp)
|
static int at86rf230_hw_init(struct at86rf230_local *lp)
|
||||||
{
|
{
|
||||||
int rc, irq_pol, irq_type;
|
int rc, irq_pol, irq_type;
|
||||||
u8 status;
|
u8 dvdd;
|
||||||
u8 csma_seed[2];
|
u8 csma_seed[2];
|
||||||
|
|
||||||
rc = at86rf230_read_subreg(lp, SR_TRX_STATUS, &status);
|
|
||||||
if (rc)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
rc = at86rf230_write_subreg(lp, SR_TRX_CMD, STATE_FORCE_TRX_OFF);
|
rc = at86rf230_write_subreg(lp, SR_TRX_CMD, STATE_FORCE_TRX_OFF);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1015,10 +1011,10 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
|
||||||
/* Wait the next SLEEP cycle */
|
/* Wait the next SLEEP cycle */
|
||||||
msleep(100);
|
msleep(100);
|
||||||
|
|
||||||
rc = at86rf230_read_subreg(lp, SR_DVDD_OK, &status);
|
rc = at86rf230_read_subreg(lp, SR_DVDD_OK, &dvdd);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
if (!status) {
|
if (!dvdd) {
|
||||||
dev_err(&lp->spi->dev, "DVDD error\n");
|
dev_err(&lp->spi->dev, "DVDD error\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue