summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_fb_helper.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-02-28 15:46:39 +0100
committerThierry Reding <treding@nvidia.com>2017-02-28 16:15:00 +0100
commitad09360750afa18a0a0ce0253d6ea6033abc22e7 (patch)
tree6d8c896081f454417a5cdc0f0eee9cfc8f07050c /drivers/gpu/drm/drm_fb_helper.c
parent020a218f95bd3ceff7dd1022ff7ebc0497bc7bf9 (diff)
downloadlwn-ad09360750afa18a0a0ce0253d6ea6033abc22e7.tar.gz
lwn-ad09360750afa18a0a0ce0253d6ea6033abc22e7.zip
drm: Introduce drm_connector_{get,put}()
For consistency with other reference counting APIs in the kernel, add drm_connector_get() and drm_connector_put() functions to reference count connectors. Compatibility aliases are added to keep existing code working. To help speed up the transition, all the instances of the old functions in the DRM core are already replaced in this commit. The existing semantic patch for mode object reference count conversion is extended for these new helpers. Reviewed-by: Sean Paul <seanpaul@chromium.org> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-4-thierry.reding@gmail.com
Diffstat (limited to 'drivers/gpu/drm/drm_fb_helper.c')
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 1b068e6264d5..b243fdbdbb08 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -148,7 +148,7 @@ fail:
struct drm_fb_helper_connector *fb_helper_connector =
fb_helper->connector_info[i];
- drm_connector_unreference(fb_helper_connector->connector);
+ drm_connector_put(fb_helper_connector->connector);
kfree(fb_helper_connector);
fb_helper->connector_info[i] = NULL;
@@ -185,7 +185,7 @@ int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_
if (!fb_helper_connector)
return -ENOMEM;
- drm_connector_reference(connector);
+ drm_connector_get(connector);
fb_helper_connector->connector = connector;
fb_helper->connector_info[fb_helper->connector_count++] = fb_helper_connector;
return 0;
@@ -211,7 +211,7 @@ int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
if (i == fb_helper->connector_count)
return -EINVAL;
fb_helper_connector = fb_helper->connector_info[i];
- drm_connector_unreference(fb_helper_connector->connector);
+ drm_connector_put(fb_helper_connector->connector);
for (j = i + 1; j < fb_helper->connector_count; j++) {
fb_helper->connector_info[j - 1] = fb_helper->connector_info[j];
@@ -633,7 +633,7 @@ static void drm_fb_helper_modeset_release(struct drm_fb_helper *helper,
int i;
for (i = 0; i < modeset->num_connectors; i++) {
- drm_connector_unreference(modeset->connectors[i]);
+ drm_connector_put(modeset->connectors[i]);
modeset->connectors[i] = NULL;
}
modeset->num_connectors = 0;
@@ -650,7 +650,7 @@ static void drm_fb_helper_crtc_free(struct drm_fb_helper *helper)
int i;
for (i = 0; i < helper->connector_count; i++) {
- drm_connector_unreference(helper->connector_info[i]->connector);
+ drm_connector_put(helper->connector_info[i]->connector);
kfree(helper->connector_info[i]);
}
kfree(helper->connector_info);
@@ -2192,7 +2192,7 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
fb_crtc->y = offset->y;
modeset->mode = drm_mode_duplicate(dev,
fb_crtc->desired_mode);
- drm_connector_reference(connector);
+ drm_connector_get(connector);
modeset->connectors[modeset->num_connectors++] = connector;
modeset->fb = fb_helper->fb;
modeset->x = offset->x;