linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: greg@kroah.com, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: [PATCH 3/6] mrst-touchscreen: Fix use before initialize in mrst_touch [Fix bug 2561]
Date: Fri, 23 Jul 2010 14:52:12 +0100	[thread overview]
Message-ID: <20100723135210.19151.19238.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100723134852.19151.6999.stgit@localhost.localdomain>

From: Arjan van de Ven <arjan@linux.intel.com>

The mrst touch screen driver, in mrstouch_adc_init does

                 dev_err(&tsdev->spi->dev, "Unable to read PMIC id\n");

which does not work very well since the tsdev->spi member does not get
initialized until after the call to mrstouch_adc_init

this patch makes sure the ->spi member is initialized prior to the call
to mrstouch_adc_init

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>


--- 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
Content-Type: text/plain;
 name="Q"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="Q"

--- 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");


  parent reply	other threads:[~2010-07-23 14:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 13:51 [PATCH 0/6] Complete the mrst touchscreen tidy Alan Cox
2010-07-23 13:51 ` [PATCH 1/6] mrst_touchscreen: clean up input side Alan Cox
2010-07-27 18:18   ` [PATCH 1/6] Staging: " Greg KH
2010-08-25 14:46     ` Dmitry Torokhov
2010-07-23 13:52 ` [PATCH 2/6] Input: mrst - more fixes Alan Cox
2010-07-23 13:52 ` Alan Cox [this message]
2010-07-27 18:17   ` [PATCH 3/6] mrst-touchscreen: Fix use before initialize in mrst_touch [Fix bug 2561] Greg KH
2010-07-23 13:52 ` [PATCH 4/6] * Register platform interface Alan Cox
2010-07-23 16:07   ` Dmitry Torokhov
2010-07-23 15:38     ` Alan Cox
2010-07-23 16:43       ` Dmitry Torokhov
2010-07-26 22:49         ` Greg KH
2010-07-27  8:16           ` Dmitry Torokhov
2010-07-27 15:22             ` Greg KH
2010-07-23 13:52 ` [PATCH 5/6] fix channel allocation in the touch screen driver Alan Cox
2010-07-23 13:52 ` [PATCH 6/6] Simplify en/disable of interrupts for NEC Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100723135210.19151.19238.stgit@localhost.localdomain \
    --to=alan@linux.intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).