[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1246211116.20525.8.camel@brutus>
Date: Sun, 28 Jun 2009 14:45:16 -0300
From: Daniel Ribeiro <drwyrm@...il.com>
To: Antonio Ospite <ospite@...denti.unina.it>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org,
openezx-devel <openezx-devel@...ts.openezx.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Harald Welte <laforge@...monks.org>,
Samuel Ortiz <sameo@...ux.intel.com>
Subject: Re: [PATCH] PCAP touchscreen driver (for 2.6.32)
Em Dom, 2009-06-28 às 16:35 +0200, Antonio Ospite escreveu:
> > + pcap_ts->pcap = platform_get_drvdata(pdev);
> > + platform_set_drvdata(pdev, pcap_ts);
> > +
> > + input_dev = input_allocate_device();
> > + if (!pcap_ts || !input_dev)
>
> Can pcap_ts be ever NULL here? This test can be simplified.
Right, it really can't be NULL. I will fix it.
> > +#ifdef CONFIG_PM
> > +static int pcap_ts_suspend(struct platform_device *pdev, pm_message_t state)
> > +{
> > + struct pcap_ts *pcap_ts = platform_get_drvdata(pdev);
> > +
> > + pcap_set_ts_bits(pcap_ts->pcap, PCAP_ADC_TS_REF_LOWPWR);
> > + return 0;
> > +}
> > +
> > +static int pcap_ts_resume(struct platform_device *pdev)
> > +{
> > + struct pcap_ts *pcap_ts = platform_get_drvdata(pdev);
> > +
> > + pcap_set_ts_bits(pcap_ts->pcap,
> > + pcap_ts->read_state << PCAP_ADC_TS_M_SHIFT);
> > + return 0;
> > +}
> > +#endif
> > +
>
> define the suspend/resume callbacks as NULL in a #else here and remove
> the #ifdef CONFIG_PM below? That seems to be the most used style.
>
> > +static struct platform_driver pcap_ts_driver = {
> > + .probe = pcap_ts_probe,
> > + .remove = __devexit_p(pcap_ts_remove),
> > +#ifdef CONFIG_PM
> > + .suspend = pcap_ts_suspend,
> > + .resume = pcap_ts_resume,
> > +#endif
> > + .driver = {
> > + .name = "pcap-ts",
> > + .owner = THIS_MODULE,
> > + },
> > +};
Ok.
Thanks for the review! :)
--
Daniel Ribeiro
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists