summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests/drm_kunit_helpers.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2022-12-01 18:11:37 +0300
committerMaxime Ripard <maxime@cerno.tech>2022-12-08 11:56:55 +0300
commit1d041a469e5de3d9d1b208e12af9265882dcd221 (patch)
tree73eee9c9cd2c970ef112c540ee6d2852ffd6b484 /drivers/gpu/drm/tests/drm_kunit_helpers.c
parent83ee69a89f32d60669e66dad1c5d841573e5a8ec (diff)
downloadlinux-1d041a469e5de3d9d1b208e12af9265882dcd221.tar.xz
drm/tests: helpers: Remove the name parameter
The device name isn't really useful, we can just define it instead of exposing it in the API. Reviewed-by: MaĆ­ra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-6-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/tests/drm_kunit_helpers.c')
-rw-r--r--drivers/gpu/drm/tests/drm_kunit_helpers.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
index e718073ba6e9..ec33fcbd092d 100644
--- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
+++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
@@ -8,6 +8,8 @@
#include <linux/device.h>
+#define KUNIT_DEVICE_NAME "drm-kunit-mock-device"
+
struct kunit_dev {
struct drm_device base;
};
@@ -39,7 +41,6 @@ static void dev_free(struct kunit_resource *res)
* drm_kunit_helper_alloc_drm_device - Allocates a mock DRM device for KUnit tests
* @test: The test context object
* @features: Mocked DRM device driver features
- * @name: Name of the struct &device to allocate
*
* This function allocates a new struct &device, creates a struct
* &drm_driver and will create a struct &drm_device using both.
@@ -54,7 +55,7 @@ static void dev_free(struct kunit_resource *res)
*/
struct drm_device *
drm_kunit_helper_alloc_drm_device(struct kunit *test,
- u32 features, char *name)
+ u32 features)
{
struct kunit_dev *kdev;
struct drm_device *drm;
@@ -62,7 +63,7 @@ drm_kunit_helper_alloc_drm_device(struct kunit *test,
struct device *dev;
int ret;
- dev = kunit_alloc_resource(test, dev_init, dev_free, GFP_KERNEL, name);
+ dev = kunit_alloc_resource(test, dev_init, dev_free, GFP_KERNEL, KUNIT_DEVICE_NAME);
if (!dev)
return ERR_PTR(-ENOMEM);