From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Subject: Re: [PATCH 07/12] tpm/st33zp24/spi: Improve st33zp24_spi_evaluate_latency Date: Thu, 11 Feb 2016 16:22:09 +0200 Message-ID: <20160211142209.GD4231@intel.com> References: <1455010021-21927-1-git-send-email-christophe-h.ricard@st.com> <1455010021-21927-8-git-send-email-christophe-h.ricard@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1455010021-21927-8-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Christophe Ricard Cc: jean-luc.blanc-qxv4g6HH51o@public.gmane.org, ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, christophe-h.ricard-qxv4g6HH51o@public.gmane.org, benoit.houyere-qxv4g6HH51o@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Tue, Feb 09, 2016 at 10:26:56AM +0100, Christophe Ricard wrote: > 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 Reviewed-by: Jarkko Sakkinen /Jarkko > --- > drivers/char/tpm/st33zp24/spi.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c > index 0af836a..7cabf1d 100644 > --- a/drivers/char/tpm/st33zp24/spi.c > +++ b/drivers/char/tpm/st33zp24/spi.c > @@ -213,6 +213,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() */ > > -- > 2.5.0 > ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140