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

Commit c05422d5 authored by Daniel Vetter's avatar Daniel Vetter Committed by Eric Anholt
Browse files

drm/i915: remove open-coded drm_mode_object_find



And clean up a small whitespace goof-up in the same function, while
I was looking at it.

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent 67cf781b
Loading
Loading
Loading
Loading
+8 −12
Original line number Original line Diff line number Diff line
@@ -3557,28 +3557,24 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
{
{
	drm_i915_private_t *dev_priv = dev->dev_private;
	drm_i915_private_t *dev_priv = dev->dev_private;
	struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
	struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
	struct drm_crtc *crtc = NULL;
	struct drm_mode_object *drmmode_obj;
	int pipe = -1;
	struct intel_crtc *crtc;


	if (!dev_priv) {
	if (!dev_priv) {
		DRM_ERROR("called with no initialization\n");
		DRM_ERROR("called with no initialization\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
	drmmode_obj = drm_mode_object_find(dev, pipe_from_crtc_id->crtc_id,
		struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
			DRM_MODE_OBJECT_CRTC);
		if (crtc->base.id == pipe_from_crtc_id->crtc_id) {
			pipe = intel_crtc->pipe;
			break;
		}
	}


	if (pipe == -1) {
	if (!drmmode_obj) {
		DRM_ERROR("no such CRTC id\n");
		DRM_ERROR("no such CRTC id\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


	pipe_from_crtc_id->pipe = pipe;
	crtc = to_intel_crtc(obj_to_crtc(drmmode_obj));
	pipe_from_crtc_id->pipe = crtc->pipe;


	return 0;
	return 0;
}
}