mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-25 03:21:00 -04:00
tpm/st33zp24/spi: Improve st33zp24_spi_evaluate_latency
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 <christophe-h.ricard@st.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
This commit is contained in:
committed by
Jarkko Sakkinen
parent
300796cdb5
commit
4ef2aa3c1b
@@ -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() */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user