summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMaíra Canal <mcanal@igalia.com>2023-01-16 17:58:01 -0300
committerMaíra Canal <mairacanal@riseup.net>2023-04-12 10:38:34 -0300
commit17e05aeb3b987a17b2ee5185264bec5db1d0c746 (patch)
tree0d276c37e06dacbd5c0a432e7692725952ef5cf1 /drivers
parent99cc528ebe923d04767e9979665a0824727376ba (diff)
downloadlwn-17e05aeb3b987a17b2ee5185264bec5db1d0c746.tar.gz
lwn-17e05aeb3b987a17b2ee5185264bec5db1d0c746.zip
drm/vkms: Use drmm_mode_config_init()
Use drmm_mode_config_init() instead of drm_mode_config_init(), as it allows us to assure that the resource will be properly cleaned. Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Maíra Canal <mairacanal@riseup.net> Link: https://patchwork.freedesktop.org/patch/msgid/20230116205800.1266227-2-mcanal@igalia.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/vkms/vkms_drv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index 6d3a2d57d992..e3c9c9571c8d 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -133,8 +133,12 @@ static const struct drm_mode_config_helper_funcs vkms_mode_config_helpers = {
static int vkms_modeset_init(struct vkms_device *vkmsdev)
{
struct drm_device *dev = &vkmsdev->drm;
+ int ret;
+
+ ret = drmm_mode_config_init(dev);
+ if (ret)
+ return ret;
- drm_mode_config_init(dev);
dev->mode_config.funcs = &vkms_mode_funcs;
dev->mode_config.min_width = XRES_MIN;
dev->mode_config.min_height = YRES_MIN;