lkml.org 
[lkml]   [2009]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] input: PCAP2 based touchscreen driver
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.


\
 
 \ /
  Last update: 2009-08-04 23:07    [W:0.057 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site