From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: "Stéphane Chatty" <chatty@enac.fr>,
"Christoph Fritz" <chf.fritz@googlemail.com>,
linux-input@vger.kernel.org, linux@philmerk.de
Subject: Re: [PATCH] Support for the eGalax dual-touch panel
Date: Sun, 11 Apr 2010 20:18:56 -0700 [thread overview]
Message-ID: <20100412031856.GD29292@core.coreip.homeip.net> (raw)
In-Reply-To: <alpine.LNX.2.00.1004102116370.8345@pobox.suse.cz>
On Sat, Apr 10, 2010 at 09:19:17PM +0200, Jiri Kosina wrote:
> On Sat, 10 Apr 2010, Stéphane Chatty wrote:
>
> > > Am Samstag, den 10.04.2010, 16:43 +0200 schrieb Stephane Chatty:
> > > > Added support for the eGalax dual-touch panel, found on the Asus EeePC
> > > > T101MT
> > >
> > > > +static void egalax_remove(struct hid_device *hdev)
> > > > +{
> > > > + hid_hw_stop(hdev);
> > > > + kfree(hid_get_drvdata(hdev));
> > > > + hid_set_drvdata(hdev, NULL);
> > > > +}
> > >
> > > Why not using hid_hw_stop() instead of hid_set_drvdata()?
> > >
> >
> > Er, actually for a previous driver Dmitry suggested to add this line and
> > I did it without trying to understand :-)
>
> Currently no code should be relying on this, but it's always nice/safe to
> do such initialization.
>
> Using 'if (!hdev)' to check whether hdev is valid/initialized or not
> should be always legitimate thing to do.
How can hdev be NULL? You did you mean hid_get_drvdata(hdev) != NULL?
In general as a driver writer I'd expect data structiures passed to me
by the core (in this case hid core) be initialized and useable...
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-04-12 3:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-10 14:43 [PATCH] Support for the eGalax dual-touch panel Stephane Chatty
2010-04-10 15:48 ` Christoph Fritz
2010-04-10 16:04 ` Christoph Fritz
2010-04-10 18:00 ` Stéphane Chatty
2010-04-10 19:19 ` Jiri Kosina
2010-04-12 3:18 ` Dmitry Torokhov [this message]
2010-04-12 6:56 ` Jiri Kosina
2010-04-12 3:21 ` Dmitry Torokhov
[not found] ` <r2l8f7062ad1004120015h21632b7v65deeae98cb1739a@mail.gmail.com>
2010-04-12 7:19 ` Christoph Fritz
2010-04-10 19:25 ` Jiri Kosina
2010-04-10 19:36 ` Stéphane Chatty
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=20100412031856.GD29292@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=chatty@enac.fr \
--cc=chf.fritz@googlemail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux@philmerk.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.