Re: [PATCH] PCAP touchscreen driver (for 2.6.32)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: Esta =?ISO-8859-1?Q?=E9?= uma parte de mensagem assinada digitalmente


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux