From patchwork Fri Jul 18 03:30:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 4579751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 16F1A9F37C for ; Fri, 18 Jul 2014 03:30:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DE312018E for ; Fri, 18 Jul 2014 03:30:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9521620125 for ; Fri, 18 Jul 2014 03:30:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7622C6E716; Thu, 17 Jul 2014 20:30:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f175.google.com (mail-qc0-f175.google.com [209.85.216.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DA7E6E716 for ; Thu, 17 Jul 2014 20:30:26 -0700 (PDT) Received: by mail-qc0-f175.google.com with SMTP id w7so2920344qcr.6 for ; Thu, 17 Jul 2014 20:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1yocmCDMiQD7WhTzYJKuyI3SWt+Qn5uHg8TAIxcyXdI=; b=sTTLX7qKTdwRqe76+SYZiRvEpxKaGqvjVJOqsEFwvfj9FzcnkNlmdmtTsxMsJanzOf /XMOVSp6HYf7T06HJbUC4NCSs4Q+uBUpiuclaruhAoazFb9Fm8tDcQVTVlhBmYzFjY2S 1qgwdyGRghH8EC61yq56zyPyJuCMzPovzfuhO4OoUhSPYg3LBUHbkG/VhX1trYaDGYxs rnF5C76DZpllAlleXGqv4pleW09nrJ3uuQlPCEBbMksMAn6RO6sC0QS2k5a/iN19pudK kP3/zHxm8Na7fodLV9RGnyw/yTcqr0AMNDJoXCDyD9KApWk7T1PK8/63PAxEf/IIWHgS y/zQ== X-Received: by 10.229.221.201 with SMTP id id9mr2972204qcb.30.1405654226123; Thu, 17 Jul 2014 20:30:26 -0700 (PDT) Received: from localhost ([172.56.22.126]) by mx.google.com with ESMTPSA id d7sm7786210qae.29.2014.07.17.20.30.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jul 2014 20:30:25 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH 05/10] drm/mgag200: use helpers Date: Thu, 17 Jul 2014 23:30:00 -0400 Message-Id: <1405654205-30810-6-git-send-email-robdclark@gmail.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1405654205-30810-1-git-send-email-robdclark@gmail.com> References: <1405654205-30810-1-git-send-email-robdclark@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Rob Clark --- drivers/gpu/drm/mgag200/mgag200_mode.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index f9fe390..45f04de 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -1562,19 +1562,9 @@ static struct drm_encoder *mga_connector_best_encoder(struct drm_connector *connector) { int enc_id = connector->encoder_ids[0]; - struct drm_mode_object *obj; - struct drm_encoder *encoder; - /* pick the encoder ids */ - if (enc_id) { - obj = - drm_mode_object_find(connector->dev, enc_id, - DRM_MODE_OBJECT_ENCODER); - if (!obj) - return NULL; - encoder = obj_to_encoder(obj); - return encoder; - } + if (enc_id) + return drm_encoder_find(connector->dev, enc_id); return NULL; }