diff mbox

[3/6] mrst-touchscreen: Fix use before initialize in mrst_touch [Fix bug 2561]

Message ID 20100723135210.19151.19238.stgit@localhost.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Alan Cox July 23, 2010, 1:52 p.m. UTC
None
diff mbox

Patch

--- linux-2.6.34/drivers/staging/mrst-touchscreen/intel-mid-touch.c~	2010-06-23 03:13:39.000000000 +0000
+++ linux-2.6.34/drivers/staging/mrst-touchscreen/intel-mid-touch.c	2010-06-23 03:14:47.736742734 +0000
@@ -759,6 +759,8 @@ 
 	tsdev->irq = myirq;
 	mrstouchdevp = tsdev;

+	tsdev->spi = mrstouch_spi;
+
 	err = mrstouch_adc_init(tsdev);
 	if (err) {
 		dev_err(&mrstouch_spi->dev, "ADC init failed\n");
@@ -766,7 +768,6 @@ 
 	}

 	dev_set_drvdata(&mrstouch_spi->dev, tsdev);
-	tsdev->spi = mrstouch_spi;

 	err = ts_input_dev_init(tsdev, mrstouch_spi);
 	if (err) {

--------------030606040305060606070104--
---

 drivers/staging/mrst-touchscreen/intel-mid-touch.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/drivers/staging/mrst-touchscreen/intel-mid-touch.c b/drivers/staging/mrst-touchscreen/intel-mid-touch.c
index 7e77737..c41989b 100644
--- a/drivers/staging/mrst-touchscreen/intel-mid-touch.c
+++ b/drivers/staging/mrst-touchscreen/intel-mid-touch.c
@@ -651,6 +651,8 @@  static int __devinit mrstouch_probe(struct spi_device *spi)
 	snprintf(tsdev->phys, sizeof(tsdev->phys),
 		 "%s/input0", dev_name(&spi->dev));
 
+	tsdev->spi = mrstouch_spi;
+
 	err = mrstouch_adc_init(tsdev);
 	if (err) {
 		dev_err(&spi->dev, "ADC initialization failed\n");