Skip to content

Commit

Permalink
tpm/st33zp24/spi: Improve st33zp24_spi_evaluate_latency
Browse files Browse the repository at this point in the history
Add check in st33zp24_spi_evaluate_latency helping to diagnose if the chip
is present or in a bad state.

Signed-off-by: Christophe Ricard <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
cricard13 authored and Jarkko Sakkinen committed Jun 25, 2016
1 parent 300796c commit 4ef2aa3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/char/tpm/st33zp24/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ static int st33zp24_spi_evaluate_latency(void *phy_id)
&data, 1);
latency++;
}
if (status < 0)
return status;
if (latency == MAX_SPI_LATENCY)
return -ENODEV;

return latency - 1;
} /* evaluate_latency() */

Expand Down

0 comments on commit 4ef2aa3

Please sign in to comment.