Received: by 10.213.65.68 with SMTP id h4csp542489imn; Fri, 30 Mar 2018 10:21:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/nfHj8IKBIjktr6P4xPaFWxoDtmS/wy0SbV2UcQEhSYHva4xeKYD8BGC94B/5vhskJPT1B X-Received: by 10.99.150.2 with SMTP id c2mr9030219pge.352.1522430487037; Fri, 30 Mar 2018 10:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522430486; cv=none; d=google.com; s=arc-20160816; b=uIBALWm1hnALJVA9tXzXcYKodWv7qkFFxNEr5swDsKaMI2SZc6RDmlrIGV+LLAfoxX 4Zv3o/19C3yGvJQuwXPqrWRcgnoPu+nToW/0HsJFdBN1S2jwXo9izd07zgA0S4kPYyCT ohA/vuK2VLqu/EunzAPlbj8Bt/zk6pQ08c5/fchv1yWzyLoUuLg6vL2GOMqnmsgCD8lk wLxw0bTdjKOQvRkT+4Ok//eD0N4otaCeLKXgaisQzHP8teQMlc6NvvCjygGP+DHjE+dB t1+Sslyc2roU3TenYCqx88zNAb/8kZnHwW4Hs5JNC20NIhCStW1nIlm3r8cL1DnuZIAt UY9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=8HbTjSMvpp0YmRC1zoQaoBGr20xIlLoMJXZrR59Q9Mk=; b=k/KlcLQmlyJPwakrK6bMYZgpSmnppl3rT58Bx4tHD1m1feqgEZJLIeifxUJeEvgqhL osJuPvxeTBQtPwp/+G7SvnZa2sIypo7VUU59F1nYF82eme2Zc1JBRu50fJQAdc+/F5Ng qamAc8bvY3t1bvZ3QGTmCqfB3ZOsg/qJgvedKsVTc9knYBCPRtiHFC8ByNpy8BIZf+oP pRcezcf+LheU/atzW0EYcJJ9WsNSufcX8ZeFQeuADJxIBRGF4n0bU2hqf3tpHw/qf6rS zCeusAV3YBiZmd7aRbXJlNK30VPRVS5V93Vg/tHb18KhMYqgtnPyQsXCv1dRtV9ItbmE Vi8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i127si3902295pfb.74.2018.03.30.10.21.13; Fri, 30 Mar 2018 10:21:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752364AbeC3RSn (ORCPT + 99 others); Fri, 30 Mar 2018 13:18:43 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:58760 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752286AbeC3RSi (ORCPT ); Fri, 30 Mar 2018 13:18:38 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 7413C2601D5 From: Sebastian Reichel To: Sebastian Reichel , Tomi Valkeinen , Tony Lindgren , Pavel Machek Cc: Laurent Pinchart , Rob Herring , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Sebastian Reichel Subject: [PATCHv3 4/8] drm/omap: make omap_framebuffer_get_next_connector static Date: Fri, 30 Mar 2018 19:18:18 +0200 Message-Id: <20180330171822.25896-5-sebastian.reichel@collabora.co.uk> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180330171822.25896-1-sebastian.reichel@collabora.co.uk> References: <20180330171822.25896-1-sebastian.reichel@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org omap_framebuffer_get_next_connector() is only required within omap_fb, so let's make it static. The function had to be moved before the first (and only) user. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/omap_fb.c | 54 +++++++++++++++++++-------------------- drivers/gpu/drm/omapdrm/omap_fb.h | 2 -- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index b65212c9a423..3f0b1f976691 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -95,6 +95,33 @@ static void omap_framebuffer_destroy(struct drm_framebuffer *fb) kfree(omap_fb); } +/* iterate thru all the connectors, returning ones that are attached + * to the same fb.. + */ +static struct drm_connector *omap_framebuffer_get_next_connector( + struct drm_framebuffer *fb, struct drm_connector *from) +{ + struct drm_device *dev = fb->dev; + struct list_head *connector_list = &dev->mode_config.connector_list; + struct drm_connector *connector = from; + + if (!from) + return list_first_entry_or_null(connector_list, typeof(*from), + head); + + list_for_each_entry_from(connector, connector_list, head) { + if (connector != from) { + struct drm_encoder *encoder = connector->encoder; + struct drm_crtc *crtc = encoder ? encoder->crtc : NULL; + if (crtc && crtc->primary->fb == fb) + return connector; + + } + } + + return NULL; +} + static int omap_framebuffer_dirty(struct drm_framebuffer *fb, struct drm_file *file_priv, unsigned flags, unsigned color, @@ -329,33 +356,6 @@ void omap_framebuffer_unpin(struct drm_framebuffer *fb) mutex_unlock(&omap_fb->lock); } -/* iterate thru all the connectors, returning ones that are attached - * to the same fb.. - */ -struct drm_connector *omap_framebuffer_get_next_connector( - struct drm_framebuffer *fb, struct drm_connector *from) -{ - struct drm_device *dev = fb->dev; - struct list_head *connector_list = &dev->mode_config.connector_list; - struct drm_connector *connector = from; - - if (!from) - return list_first_entry_or_null(connector_list, typeof(*from), - head); - - list_for_each_entry_from(connector, connector_list, head) { - if (connector != from) { - struct drm_encoder *encoder = connector->encoder; - struct drm_crtc *crtc = encoder ? encoder->crtc : NULL; - if (crtc && crtc->primary->fb == fb) - return connector; - - } - } - - return NULL; -} - #ifdef CONFIG_DEBUG_FS void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m) { diff --git a/drivers/gpu/drm/omapdrm/omap_fb.h b/drivers/gpu/drm/omapdrm/omap_fb.h index 94ad5f9e4404..c20cb4bc714d 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.h +++ b/drivers/gpu/drm/omapdrm/omap_fb.h @@ -38,8 +38,6 @@ int omap_framebuffer_pin(struct drm_framebuffer *fb); void omap_framebuffer_unpin(struct drm_framebuffer *fb); void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, struct drm_plane_state *state, struct omap_overlay_info *info); -struct drm_connector *omap_framebuffer_get_next_connector( - struct drm_framebuffer *fb, struct drm_connector *from); bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb); void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m); -- 2.16.2