From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Richard Röjfors" <richard.rojfors.ext@mocean-labs.com>
Cc: linux-input@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
kwangwoo.lee@gmail.com,
Thierry Reding <thierry.reding@avionic-design.de>,
Trilok Soni <soni.trilok@gmail.com>
Subject: Re: [PATCH 2/2] tsc2007: reduced number of I2C transfers
Date: Tue, 4 Aug 2009 22:04:43 -0700 [thread overview]
Message-ID: <20090805050445.1C034526EA5@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <4A7825B3.1010806@mocean-labs.com>
On Tue, Aug 04, 2009 at 02:12:35PM +0200, Richard Röjfors wrote:
> Dmitry Torokhov wrote:
>>
>> I modified the patch a bit before applying. In fact there were a few
>> changes to all the patces so it would be nice if you could take a look
>> at the 'next' branch of my tree:
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
>>
>> Also, I di dnot quite like the logic of the patch making
>> get_pendown_state callback optional; could you please try the patch
>> below and let me know of it works for you?
>
> I like your changes, there is just a small miss while checking the
> platform data. You forgot to remove the check for get_pen_down_state in
> the probe function, see the patch below (to be applied on top of yours):
>
> I also would like a check if the power down failed or not during probe.
>
> --Richard
>
> Input: tsc2007 - Check if I2C communication works during probe
>
> Check the result when sending the power down command to the controller.
>
> Signed-off-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
> ---
> Index: linux-2.6.31-rc2/drivers/input/touchscreen/tsc2007.c
> ===================================================================
> --- linux-2.6.31-rc2/drivers/input/touchscreen/tsc2007.c (revision 1071)
> +++ linux-2.6.31-rc2/drivers/input/touchscreen/tsc2007.c (revision 1073)
> @@ -269,7 +269,7 @@
> struct input_dev *input_dev;
> int err;
>
> - if (!pdata || !pdata->get_pendown_state) {
> + if (!pdata) {
> dev_err(&client->dev, "platform data is required!\n");
> return -EINVAL;
> }
Ah, yes, thanks.
> @@ -326,10 +326,14 @@
> i2c_set_clientdata(client, ts);
>
> /* Prepare for touch readings - power down ADC and enable PENIRQ */
> - tsc2007_xfer(ts, PWRDOWN);
> + err = tsc2007_xfer(ts, PWRDOWN);
> + if (err < 0)
> + goto err_unreg_dev;
>
> return 0;
>
> + err_unreg_dev:
> + input_unregister_device(ts->input);
This will case double free.. I will adjust locally.
> err_free_irq:
> tsc2007_free_irq(ts);
> if (pdata->exit_platform_hw)
--
Dmitry
prev parent reply other threads:[~2009-08-05 5:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 16:14 [PATCH 2/2] tsc2007: reduced number of I2C transfers Richard Röjfors
2009-07-24 18:00 ` Dmitry Torokhov
2009-07-24 19:37 ` Richard Röjfors
2009-07-26 8:02 ` Dmitry Torokhov
2009-08-04 12:12 ` Richard Röjfors
2009-08-05 5:04 ` Dmitry Torokhov [this message]
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=20090805050445.1C034526EA5@mailhub.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=kwangwoo.lee@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.rojfors.ext@mocean-labs.com \
--cc=soni.trilok@gmail.com \
--cc=thierry.reding@avionic-design.de \
/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).