On Sun, Aug 7, 2022 at 8:46 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote: > > From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > > If CONFIG_PM is not set, the pm_ptr() will ensure that the struct > dev_pm_ops and callbacks are removed without the need for __maybe_unused > markings. > > In this case we can't simply use DEFINE_RUNTIME_DEV_PM_OPS() because > that would provide suspend and resume functions without the > checks the driver is doing before calling runtime_pm functions > (whether the necessary GPIO is provided). It may be possible to > clean that up in future by moving the checks into the callbacks. ... > static const struct dev_pm_ops srf04_pm_ops = { > - SET_RUNTIME_PM_OPS(srf04_pm_runtime_suspend, > - srf04_pm_runtime_resume, NULL) > + RUNTIME_PM_OPS(srf04_pm_runtime_suspend, > + srf04_pm_runtime_resume, NULL) > }; static DEFINE_RUNTIME_DEV_PM_OPS(...); ? -- With Best Regards, Andy Shevchenko