[PATCH 5/8] drm/i915/dmc: don't register DMC debugfs file if there's no DMC

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

 



Register the DMC debugfs file only on platforms that support
DMC. There's no point in having a no-op debugfs file.

Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 drivers/gpu/drm/i915/display/intel_dmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index 5de13f978e57..8dfa2aa9f8bd 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -818,9 +818,6 @@ static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
 	struct intel_dmc *dmc;
 	i915_reg_t dc5_reg, dc6_reg = INVALID_MMIO_REG;
 
-	if (!HAS_DMC(i915))
-		return -ENODEV;
-
 	dmc = &i915->dmc;
 
 	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
@@ -890,6 +887,9 @@ void intel_dmc_debugfs_register(struct drm_i915_private *i915)
 {
 	struct drm_minor *minor = i915->drm.primary;
 
+	if (!HAS_DMC(i915))
+		return;
+
 	debugfs_create_file("i915_dmc_info", 0444, minor->debugfs_root,
 			    i915, &intel_dmc_debugfs_status_fops);
 }
-- 
2.30.2




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux