Message ID | 1608110114-32024-1-git-send-email-tiantao6@hisilicon.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/hisilicon: Add the CONFIG_PM_SLEEP | expand |
Hi Tian, On Wed, Dec 16, 2020 at 05:15:14PM +0800, Tian Tao wrote: > add the CONFIG_PM_SLEEP to isolate the function of resume and suspend. > > Signed-off-by: Tian Tao <tiantao6@hisilicon.com> > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > index 7e91ef1..faa664d 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > @@ -65,6 +65,7 @@ static const struct drm_driver hibmc_driver = { > .irq_handler = hibmc_drm_interrupt, > }; > > +#ifdef CONFIG_PM_SLEEP > static int __maybe_unused hibmc_pm_suspend(struct device *dev) > { > struct drm_device *drm_dev = dev_get_drvdata(dev); > @@ -78,6 +79,7 @@ static int __maybe_unused hibmc_pm_resume(struct device *dev) > > return drm_mode_config_helper_resume(drm_dev); > } > +#endif The __maybe_unused in combination of the use of SET_SYSTEM_SLEEP_PM_OPS() should cover all situations and the ifdef should not be required. So unless you are trying to fix a warning or so then there is no reason to do this change. The linker will drop the function in the end and the __maybe_unused will prevent a compile-time warning. Sam
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 7e91ef1..faa664d 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -65,6 +65,7 @@ static const struct drm_driver hibmc_driver = { .irq_handler = hibmc_drm_interrupt, }; +#ifdef CONFIG_PM_SLEEP static int __maybe_unused hibmc_pm_suspend(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); @@ -78,6 +79,7 @@ static int __maybe_unused hibmc_pm_resume(struct device *dev) return drm_mode_config_helper_resume(drm_dev); } +#endif static const struct dev_pm_ops hibmc_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(hibmc_pm_suspend,
add the CONFIG_PM_SLEEP to isolate the function of resume and suspend. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 ++ 1 file changed, 2 insertions(+)