linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Antonio Ospite <ospite@studenti.unina.it>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Daniel Ribeiro <drwyrm@gmail.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	eric.y.miao@gmail.com, linux-arm-kernel@lists.arm.linux.org.uk,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	openezx-devel@lists.openezx.org,
	Stefan Schmidt <stefan@datenfreihafen.org>
Subject: Re: [PATCH v2] input: PCAP2 based touchscreen driver
Date: Tue, 4 Aug 2009 22:03:42 +0100	[thread overview]
Message-ID: <20090804210342.GC29518@sirena.org.uk> (raw)
In-Reply-To: <20090804225247.8a0bf6d4.ospite@studenti.unina.it>

On Tue, Aug 04, 2009 at 10:52:47PM +0200, Antonio Ospite wrote:
> Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:

> > > +static int __devinit pcap_ts_probe(struct platform_device *pdev)
> > > +{
> > > +	struct input_dev *input_dev;
> > > +	struct pcap_ts *pcap_ts;
> > > +	int err = -ENOMEM;
> > > +
> > > +	pcap_ts = kzalloc(sizeof(*pcap_ts), GFP_KERNEL);
> > > +	if (!pcap_ts)
> > > +		return err;
> > > +
> > > +	pcap_ts->pcap = platform_get_drvdata(pdev);
> > > +	platform_set_drvdata(pdev, pcap_ts);

> > Ewww... Don't mess with data that does not belong to you. Also I don't
> > see where you restore it so after unloading the driver reload with
> > probably lead to "inetersting" results.

> Dmitry can you suggest a better way to make the pcap_ts pointer get to
> pcap_ts_remove()? We need it in order to remove the input device.
> Or keeping this hack, restoring the original value on remove, can be
> acceptable?

> We will have to fix this also in all other pcap subdrivers.

Two options from other MFDs:

 - Include the data for the input device in the main pcap data; this
   removes the need to faff around with the 
 - Always find the main pcap data by using dev_get_drvdata() on the
   parent device of the child, perhaps keeping a copy of a pointer to
   it in the local data for simplicity.

  reply	other threads:[~2009-08-04 21:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03  9:30 [PATCH v2] input: PCAP2 based touchscreen driver Daniel Ribeiro
2009-08-03 17:21 ` Dmitry Torokhov
2009-08-04 20:52   ` Antonio Ospite
2009-08-04 21:03     ` Mark Brown [this message]
2009-08-05  8:07     ` Dmitry Torokhov

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=20090804210342.GC29518@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=drwyrm@gmail.com \
    --cc=eric.y.miao@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openezx-devel@lists.openezx.org \
    --cc=ospite@studenti.unina.it \
    --cc=sameo@linux.intel.com \
    --cc=stefan@datenfreihafen.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).