mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-19 03:53:51 -04:00
drm/tests: helpers: Allow for a custom device struct to be allocated
The current helper to allocate a DRM device doesn't allow for any subclassing by drivers, which is going to be troublesome as we work on getting some kunit testing on atomic modesetting code. Let's use a similar pattern to the other allocation helpers by providing the structure size and offset as arguments. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-10-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
This commit is contained in:
@@ -26,8 +26,9 @@ static int drm_test_modes_init(struct kunit *test)
|
||||
priv->dev = drm_kunit_helper_alloc_device(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->dev);
|
||||
|
||||
priv->drm = drm_kunit_helper_alloc_drm_device(test, priv->dev,
|
||||
DRIVER_MODESET);
|
||||
priv->drm = __drm_kunit_helper_alloc_drm_device(test, priv->dev,
|
||||
sizeof(*priv->drm), 0,
|
||||
DRIVER_MODESET);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->drm);
|
||||
|
||||
test->priv = priv;
|
||||
|
||||
Reference in New Issue
Block a user