Commit 10460bc1 authored by Christophe RICARD's avatar Christophe RICARD Committed by Jarkko Sakkinen

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: default avatarChristophe Ricard <christophe-h.ricard@st.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
parent b55c8e9f
...@@ -214,6 +214,11 @@ static int st33zp24_spi_evaluate_latency(void *phy_id) ...@@ -214,6 +214,11 @@ static int st33zp24_spi_evaluate_latency(void *phy_id)
&data, 1); &data, 1);
latency++; latency++;
} }
if (status < 0)
return status;
if (latency == MAX_SPI_LATENCY)
return -ENODEV;
return latency - 1; return latency - 1;
} /* evaluate_latency() */ } /* evaluate_latency() */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment