[CI,1/2] drm: Export drm_minor_create_anonfile()
diff mbox series

Message ID 20200101134204.706541-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [CI,1/2] drm: Export drm_minor_create_anonfile()
Related show

Commit Message

Chris Wilson Jan. 1, 2020, 1:42 p.m. UTC
Export the routine for creating an anonymous file for wrapping the
drm_device.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/drm_file.c                | 7 ++++---
 drivers/gpu/drm/i915/selftests/igt_mmap.c | 2 +-
 drivers/gpu/drm/i915/selftests/mock_drm.h | 2 +-
 include/drm/drm_file.h                    | 3 ++-
 4 files changed, 8 insertions(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 92d16724f949..0f1e902191a9 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -758,7 +758,7 @@  void drm_send_event(struct drm_device *dev, struct drm_pending_event *e)
 EXPORT_SYMBOL(drm_send_event);
 
 /**
- * mock_drm_getfile - Create a new struct file for the drm device
+ * drm_minor_create_anonfile - Create a new struct file for the drm device
  * @minor: drm minor to wrap (e.g. #drm_device.primary)
  * @flags: file creation mode (O_RDWR etc)
  *
@@ -771,7 +771,8 @@  EXPORT_SYMBOL(drm_send_event);
  * RETURNS:
  * Pointer to newly created struct file, ERR_PTR on failure.
  */
-struct file *mock_drm_getfile(struct drm_minor *minor, unsigned int flags)
+struct file *
+drm_minor_create_anonfile(struct drm_minor *minor, unsigned int flags)
 {
 	struct drm_device *dev = minor->dev;
 	struct drm_file *priv;
@@ -795,4 +796,4 @@  struct file *mock_drm_getfile(struct drm_minor *minor, unsigned int flags)
 
 	return file;
 }
-EXPORT_SYMBOL_FOR_TESTS_ONLY(mock_drm_getfile);
+EXPORT_SYMBOL(drm_minor_create_anonfile);
diff --git a/drivers/gpu/drm/i915/selftests/igt_mmap.c b/drivers/gpu/drm/i915/selftests/igt_mmap.c
index 583a4ff8b8c9..85105900f3f4 100644
--- a/drivers/gpu/drm/i915/selftests/igt_mmap.c
+++ b/drivers/gpu/drm/i915/selftests/igt_mmap.c
@@ -19,7 +19,7 @@  unsigned long igt_mmap_node(struct drm_i915_private *i915,
 	int err;
 
 	/* Pretend to open("/dev/dri/card0") */
-	file = mock_drm_getfile(i915->drm.primary, O_RDWR);
+	file = drm_minor_create_anonfile(i915->drm.primary, O_RDWR);
 	if (IS_ERR(file))
 		return PTR_ERR(file);
 
diff --git a/drivers/gpu/drm/i915/selftests/mock_drm.h b/drivers/gpu/drm/i915/selftests/mock_drm.h
index 9916b6f95526..0d7ed9b05ee0 100644
--- a/drivers/gpu/drm/i915/selftests/mock_drm.h
+++ b/drivers/gpu/drm/i915/selftests/mock_drm.h
@@ -34,7 +34,7 @@  struct file;
 
 static inline struct file *mock_file(struct drm_i915_private *i915)
 {
-	return mock_drm_getfile(i915->drm.primary, O_RDWR);
+	return drm_minor_create_anonfile(i915->drm.primary, O_RDWR);
 }
 
 static inline struct drm_file *to_drm_file(struct file *f)
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 8b099b347817..42459aaac794 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -388,6 +388,7 @@  void drm_event_cancel_free(struct drm_device *dev,
 void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e);
 void drm_send_event(struct drm_device *dev, struct drm_pending_event *e);
 
-struct file *mock_drm_getfile(struct drm_minor *minor, unsigned int flags);
+struct file *drm_minor_create_anonfile(struct drm_minor *minor,
+				       unsigned int flags);
 
 #endif /* _DRM_FILE_H_ */