Skip to contentSkip to conversation

Fix tsx210x detection

PATCH Tony Lindgren 1 participant 1 message Mar 13, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20080306005848.GA20807@party

#1 lore raw
Quoted 10 lines · Kyungmin Park

If the return value is all 0xff, it means there's no device.

---

drivers/spi/tsc210x.c +0 -0
index df8bcf9..1d2ac94 100644
@@ -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);

drivers/spi/tsc210x.c static int tsc210x_probe(struct spi_device *spi, enum tsc_type type) · line 1102

Quoted 10 lines
drivers/spi/tsc210x.c +5 -0
 		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);

Pushing today.

Tony