Re: [V4, 2/2] media: i2c: Add DW9768 VCM driver

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

 



On Tue, Mar 31, 2020 at 10:16:20AM +0800, Dongchun Zhu wrote:
> On Mon, 2020-03-30 at 16:57 +0300, Andy Shevchenko wrote:
> > On Mon, Mar 30, 2020 at 08:36:34PM +0800, Dongchun Zhu wrote:
> > > This patch adds a V4L2 sub-device driver for DW9768 voice coil moter,
> > > providing control to set the desired focus via I2C serial interface.
> > 
> > ...
> > 
> > > +static const struct dev_pm_ops dw9768_pm_ops = {
> > > +	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
> > > +				pm_runtime_force_resume)
> > > +	SET_RUNTIME_PM_OPS(dw9768_runtime_suspend, dw9768_runtime_resume, NULL)
> > > +};
> > > +
> > > +static struct i2c_driver dw9768_i2c_driver = {
> > > +	.driver = {
> > > +		.name = DW9768_NAME,
> > 
> > > +		.pm = IS_ENABLED(CONFIG_PM) ? &dw9768_pm_ops : NULL,
> > 
> > What is this conditional for?
> > 
> 
> For the dw9768_pm_ops, here my idea is to use an IS_ENABLED() check to
> avoid defining the structure when CONFIG_PM is not set.

Have you looked at the implementation of SET_SYSTEM_SLEEP_OPS() and another one?

Have you tried to actually compile with !CONFIG_PM? In your case the warning
should be issued.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux