Skip to content

Commit 457ca96

Browse files
arndblucasdemarchi
authored andcommitted
drm/xe: fix build warning with CONFIG_PM=n
The 'runtime_status' field is an implementation detail of the power management code, so a device driver should not normally touch this: drivers/gpu/drm/xe/xe_pm.c: In function 'xe_pm_suspending_or_resuming': drivers/gpu/drm/xe/xe_pm.c:606:26: error: 'struct dev_pm_info' has no member named 'runtime_status' 606 | return dev->power.runtime_status == RPM_SUSPENDING || | ^ drivers/gpu/drm/xe/xe_pm.c:607:27: error: 'struct dev_pm_info' has no member named 'runtime_status' 607 | dev->power.runtime_status == RPM_RESUMING; | ^ drivers/gpu/drm/xe/xe_pm.c:608:1: error: control reaches end of non-void function [-Werror=return-type] Add an #ifdef check to avoid the build regression. Fixes: ad92f52 ("drm/xe: Suppress missing outer rpm protection warning") Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]> (cherry picked from commit 1c129ed) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent ad92f52 commit 457ca96

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/xe/xe_pm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,14 @@ bool xe_pm_runtime_get_if_in_use(struct xe_device *xe)
601601
*/
602602
static bool xe_pm_suspending_or_resuming(struct xe_device *xe)
603603
{
604+
#ifdef CONFIG_PM
604605
struct device *dev = xe->drm.dev;
605606

606607
return dev->power.runtime_status == RPM_SUSPENDING ||
607608
dev->power.runtime_status == RPM_RESUMING;
609+
#else
610+
return false;
611+
#endif
608612
}
609613

610614
/**

0 commit comments

Comments
 (0)