Skip to content

Commit 0a3f3f7

Browse files
committed
drm/vkms: Switch to managed for connector
The current VKMS driver uses non-managed function to create connectors. It is not an issue yet, but in order to support multiple devices easily, convert this code to use drm and device managed helpers. Reviewed-by: Maxime Ripard <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Reviewed-by: José Expósito <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Louis Chauvet <[email protected]>
1 parent cdb7345 commit 0a3f3f7

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/gpu/drm/vkms/vkms_output.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
#include "vkms_drv.h"
44
#include <drm/drm_atomic_helper.h>
55
#include <drm/drm_edid.h>
6+
#include <drm/drm_managed.h>
67
#include <drm/drm_probe_helper.h>
78

89
static const struct drm_connector_funcs vkms_connector_funcs = {
910
.fill_modes = drm_helper_probe_single_connector_modes,
10-
.destroy = drm_connector_cleanup,
1111
.reset = drm_atomic_helper_connector_reset,
1212
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
1313
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
@@ -75,8 +75,8 @@ int vkms_output_init(struct vkms_device *vkmsdev)
7575
}
7676
}
7777

78-
ret = drm_connector_init(dev, connector, &vkms_connector_funcs,
79-
DRM_MODE_CONNECTOR_VIRTUAL);
78+
ret = drmm_connector_init(dev, connector, &vkms_connector_funcs,
79+
DRM_MODE_CONNECTOR_VIRTUAL, NULL);
8080
if (ret) {
8181
DRM_ERROR("Failed to init connector\n");
8282
return ret;
@@ -88,7 +88,7 @@ int vkms_output_init(struct vkms_device *vkmsdev)
8888
DRM_MODE_ENCODER_VIRTUAL, NULL);
8989
if (ret) {
9090
DRM_ERROR("Failed to init encoder\n");
91-
goto err_encoder;
91+
return ret;
9292
}
9393
encoder->possible_crtcs = drm_crtc_mask(crtc);
9494

@@ -110,9 +110,5 @@ int vkms_output_init(struct vkms_device *vkmsdev)
110110

111111
err_attach:
112112
drm_encoder_cleanup(encoder);
113-
114-
err_encoder:
115-
drm_connector_cleanup(connector);
116-
117113
return ret;
118114
}

0 commit comments

Comments
 (0)