lkml.org 
[lkml]   [2009]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] PCAP touchscreen driver (for 2.6.32)
From
Date
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2009-06-28 19:47    [W:0.092 / U:1.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site