diff mbox series

[2/2] drm/debugfs: also take per device driver features into account

Message ID 20200121105331.6825-2-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm: support feature masks in drm_core_check_feature() | expand

Commit Message

Jani Nikula Jan. 21, 2020, 10:53 a.m. UTC
Use drm_core_check_feature() to ensure both the driver features and the
per-device driver features are taken into account when registering
debugfs files.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_debugfs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index eab0f2687cd6..af3531bf57d3 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -180,10 +180,7 @@  int drm_debugfs_create_files(const struct drm_info_list *files, int count,
 	int i;
 
 	for (i = 0; i < count; i++) {
-		u32 features = files[i].driver_features;
-
-		if (features != 0 &&
-		    (dev->driver->driver_features & features) != features)
+		if (!drm_core_check_feature(dev, files[i].driver_features))
 			continue;
 
 		tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);