Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2135ea7a authored by Thierry Reding's avatar Thierry Reding
Browse files

drm: Rename drm_mode_object_get()



Subsequent patches will introduce reference counting APIs that are more
consistent with similar APIs throughout the Linux kernel. These APIs use
the _get() and _put() suffixes and will collide with this existing
function.

Rename the function to drm_mode_object_add() which is a slightly more
accurate description of what it does. Also the kerneldoc for this
function gives an indication that it's badly named because it doesn't
actually acquire a reference to anything.

Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-2-thierry.reding@gmail.com
parent 499447db
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ int drm_connector_init(struct drm_device *dev,
	struct ida *connector_ida =
		&drm_connector_enum_list[connector_type].ida;

	ret = drm_mode_object_get_reg(dev, &connector->base,
	ret = __drm_mode_object_add(dev, &connector->base,
				    DRM_MODE_OBJECT_CONNECTOR,
				    false, drm_connector_free);
	if (ret)
+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
	spin_lock_init(&crtc->commit_lock);

	drm_modeset_lock_init(&crtc->mutex);
	ret = drm_mode_object_get(dev, &crtc->base, DRM_MODE_OBJECT_CRTC);
	ret = drm_mode_object_add(dev, &crtc->base, DRM_MODE_OBJECT_CRTC);
	if (ret)
		return ret;

+5 −7
Original line number Diff line number Diff line
@@ -98,15 +98,13 @@ int drm_mode_destroyblob_ioctl(struct drm_device *dev,
			       void *data, struct drm_file *file_priv);

/* drm_mode_object.c */
int drm_mode_object_get_reg(struct drm_device *dev,
			    struct drm_mode_object *obj,
			    uint32_t obj_type,
			    bool register_obj,
int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
			  uint32_t obj_type, bool register_obj,
			  void (*obj_free_cb)(struct kref *kref));
int drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj,
			uint32_t obj_type);
void drm_mode_object_register(struct drm_device *dev,
			      struct drm_mode_object *obj);
int drm_mode_object_get(struct drm_device *dev,
			struct drm_mode_object *obj, uint32_t obj_type);
struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev,
					       uint32_t id, uint32_t type);
void drm_mode_object_unregister(struct drm_device *dev,
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ int drm_encoder_init(struct drm_device *dev,
{
	int ret;

	ret = drm_mode_object_get(dev, &encoder->base, DRM_MODE_OBJECT_ENCODER);
	ret = drm_mode_object_add(dev, &encoder->base, DRM_MODE_OBJECT_ENCODER);
	if (ret)
		return ret;

+2 −2
Original line number Diff line number Diff line
@@ -638,7 +638,7 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,

	fb->funcs = funcs;

	ret = drm_mode_object_get_reg(dev, &fb->base, DRM_MODE_OBJECT_FB,
	ret = __drm_mode_object_add(dev, &fb->base, DRM_MODE_OBJECT_FB,
				    false, drm_framebuffer_free);
	if (ret)
		goto out;
Loading