]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Fix tsx210x detection
authorKyungmin Park <kyungmin.park@samsung.com>
Thu, 6 Mar 2008 00:58:48 +0000 (09:58 +0900)
committerTony Lindgren <tony@atomide.com>
Thu, 13 Mar 2008 11:31:29 +0000 (13:31 +0200)
If the return value is all 0xff, it means there's no device.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/spi/tsc210x.c

index df8bcf91bf9d1f6e8789b4b9e70897a8a2c8d2c6..1d2ac94084c477590d151a38fe96c3f2090ea56c 100644 (file)
@@ -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);