diff mbox series

drm/i915/gt: Fixup config ifdeffery for pm_suspend_target_state

Message ID 20191120182209.3967833-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series drm/i915/gt: Fixup config ifdeffery for pm_suspend_target_state | expand

Commit Message

Chris Wilson Nov. 20, 2019, 6:22 p.m. UTC
pm_suspend_target_state is declared under CONFIG_PM_SLEEP but only
defined under CONFIG_SUSPEND. Play safe and only use the symbol if it is
both declared and defines.

Reported-by: kbuild-all@lists.01.org
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes: a70a9e998e8e ("drm/i915: Defer rc6 shutdown to suspend_late")
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joonas Lahtinen Nov. 20, 2019, 7:21 p.m. UTC | #1
Quoting Chris Wilson (2019-11-20 20:22:09)
> pm_suspend_target_state is declared under CONFIG_PM_SLEEP but only
> defined under CONFIG_SUSPEND. Play safe and only use the symbol if it is
> both declared and defines.
> 
> Reported-by: kbuild-all@lists.01.org
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Fixes: a70a9e998e8e ("drm/i915: Defer rc6 shutdown to suspend_late")
> Cc: Andi Shyti <andi.shyti@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
Andi Shyti Nov. 21, 2019, 9:52 a.m. UTC | #2
Hi Chris,

> pm_suspend_target_state is declared under CONFIG_PM_SLEEP but only
> defined under CONFIG_SUSPEND. Play safe and only use the symbol if it is
> both declared and defines.
> 
> Reported-by: kbuild-all@lists.01.org
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Fixes: a70a9e998e8e ("drm/i915: Defer rc6 shutdown to suspend_late")
> Cc: Andi Shyti <andi.shyti@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

Thanks,
Andi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index 060ee0f44c70..982040ecbd01 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -275,7 +275,7 @@  void intel_gt_suspend_prepare(struct intel_gt *gt)
 
 static suspend_state_t pm_suspend_target(void)
 {
-#if IS_ENABLED(CONFIG_PM_SLEEP)
+#if IS_ENABLED(CONFIG_SUSPEND) && IS_ENABLED(CONFIG_PM_SLEEP)
 	return pm_suspend_target_state;
 #else
 	return PM_SUSPEND_TO_IDLE;