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
This commit is contained in:
parent
99cc528ebe
commit
17e05aeb3b
|
@ -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)
|
static int vkms_modeset_init(struct vkms_device *vkmsdev)
|
||||||
{
|
{
|
||||||
struct drm_device *dev = &vkmsdev->drm;
|
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.funcs = &vkms_mode_funcs;
|
||||||
dev->mode_config.min_width = XRES_MIN;
|
dev->mode_config.min_width = XRES_MIN;
|
||||||
dev->mode_config.min_height = YRES_MIN;
|
dev->mode_config.min_height = YRES_MIN;
|
||||||
|
|
Loading…
Reference in New Issue