Re: [PATCH] Fix tsx210x detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Kyungmin Park <kyungmin.park@xxxxxxxxxxx> [080306 02:59]:
> If the return value is all 0xff, it means there's no device.
> 
> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
> ---
> diff --git a/drivers/spi/tsc210x.c b/drivers/spi/tsc210x.c
> index df8bcf9..1d2ac94 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);

Pushing today.

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux