From 8840cbd3e6f059d87e42272152cb8d03728b71c5 Mon Sep 17 00:00:00 2001 From: Kyungmin Park Date: Thu, 6 Mar 2008 09:58:48 +0900 Subject: [PATCH] Fix tsx210x detection If the return value is all 0xff, it means there's no device. Signed-off-by: Kyungmin Park Signed-off-by: Tony Lindgren --- drivers/spi/tsc210x.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/spi/tsc210x.c b/drivers/spi/tsc210x.c index df8bcf91bf9..1d2ac94084c 100644 --- a/drivers/spi/tsc210x.c +++ b/drivers/spi/tsc210x.c @@ -1092,6 +1092,11 @@ static int tsc210x_probe(struct spi_device *spi, enum tsc_type type) dev_dbg(&dev->spi->dev, "revision, err %d\n", err); goto err_spi; } + if (reg == 0xffff) { + err = -ENODEV; + dev_dbg(&dev->spi->dev, "no device, err %d\n", err); + goto err_spi; + } dev_info(&spi->dev, "rev %d, irq %d\n", reg & 0x0007, spi->irq); err = tsc210x_configure(dev); -- 2.41.0