From patchwork Fri Jul 17 09:04:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11669603 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8815213A4 for ; Fri, 17 Jul 2020 09:05:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6444B2083E for ; Fri, 17 Jul 2020 09:05:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="WHVqR2AI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6444B2083E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5793F6ED75; Fri, 17 Jul 2020 09:04:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 17EC86ED6F for ; Fri, 17 Jul 2020 09:04:50 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id r12so10108481wrj.13 for ; Fri, 17 Jul 2020 02:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Njpphje98U3+SdW65R+757vXcpowDBWNDM4n7lCkJN8=; b=WHVqR2AIX2uOjaiO7NxFnhvWKjohX33YKhjzkKPrtvalc/qzIA5spdl0y6rb8Rbw6T XNo2Nx37kCB35IlcBlhq74muZqjF6tBNmyTtwxkSNagbMYZpHbAEPt7F/Rg26lJMxGko XmXbmAMlwHfn9xlIbzxiqEsMktRYU4oNVvZt0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Njpphje98U3+SdW65R+757vXcpowDBWNDM4n7lCkJN8=; b=l2oT3aoQwXNphID55rQG/eH18ccBs1k+BXJ97Bn6VZbhaw0LE3aYpMOEv7ER7H3EnK Y75x9iqLbEF6ho1WB+ocKhgpi3m+V0NBtGXh2KnAzkK6NpnoE8OaQtlKcCKrrnDreUBH d1flShCFYE3bCwAABMmW6Ylb9K8cqodLoJYwpdXPViqQPX/lTJxPtgBr2CVNNZ7/PY2A 6lZPpidOLjsC3tRthofQPMfsOkSZX6y9r5hH50xqrKxiNp5EcvJDbOmdoY7+pfG3P65u fa++h6KyAnpeo4Cy2gUoHib9eHcmr5xZMJLb/7iQbT3bqLDq1qwqR9oUG4x4JNVAhmtH +nZg== X-Gm-Message-State: AOAM533nBCbJp+/dtRDRmH15KgcRErNJpf4cEKva4JtSZrYYE/DkhwtE lm55Of2ns/sUViBtihDWXCUtssQc50w= X-Google-Smtp-Source: ABdhPJzoK+WO+JJy7zCApfsIY7GSwosIfQ+13upZ3FLTME2Eon2neRmeG/KZY8nJVbBena3ndC1PFQ== X-Received: by 2002:a5d:484b:: with SMTP id n11mr8918861wrs.320.1594976688444; Fri, 17 Jul 2020 02:04:48 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l67sm14520833wml.13.2020.07.17.02.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 02:04:47 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 14/18] drm/arc: Inline arcpgu_drm_hdmi_init Date: Fri, 17 Jul 2020 11:04:26 +0200 Message-Id: <20200717090430.1146256-14-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200717090430.1146256-1-daniel.vetter@ffwll.ch> References: <20200717090430.1146256-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Really not worth the function, much less the separate file now that almost all the code is gone. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/arc/Makefile | 2 +- drivers/gpu/drm/arc/arcpgu.h | 1 - drivers/gpu/drm/arc/arcpgu_drv.c | 12 +++++++++--- drivers/gpu/drm/arc/arcpgu_hdmi.c | 27 --------------------------- 4 files changed, 10 insertions(+), 32 deletions(-) delete mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c diff --git a/drivers/gpu/drm/arc/Makefile b/drivers/gpu/drm/arc/Makefile index c686e0287a71..379a1145bc2f 100644 --- a/drivers/gpu/drm/arc/Makefile +++ b/drivers/gpu/drm/arc/Makefile @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only -arcpgu-y := arcpgu_hdmi.o arcpgu_sim.o arcpgu_drv.o +arcpgu-y := arcpgu_sim.o arcpgu_drv.o obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o diff --git a/drivers/gpu/drm/arc/arcpgu.h b/drivers/gpu/drm/arc/arcpgu.h index cee2448a07d6..7dce0c2313ba 100644 --- a/drivers/gpu/drm/arc/arcpgu.h +++ b/drivers/gpu/drm/arc/arcpgu.h @@ -34,7 +34,6 @@ static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu, return ioread32(arcpgu->regs + reg); } -int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np); int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np); #endif diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c index 25edb4e4dff2..40697cab0d03 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -230,9 +230,15 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu) } if (encoder_node) { - ret = arcpgu_drm_hdmi_init(drm, encoder_node); - of_node_put(encoder_node); - if (ret < 0) + struct drm_bridge *bridge; + + /* Locate drm bridge from the hdmi encoder DT node */ + bridge = of_drm_find_bridge(encoder_node); + if (!bridge) + return -EPROBE_DEFER; + + ret = drm_simple_display_pipe_attach_bridge(&arcpgu->pipe, bridge); + if (ret) return ret; } else { dev_info(drm->dev, "no encoder found. Assumed virtual LCD on simulation platform\n"); diff --git a/drivers/gpu/drm/arc/arcpgu_hdmi.c b/drivers/gpu/drm/arc/arcpgu_hdmi.c deleted file mode 100644 index d430af686cbc..000000000000 --- a/drivers/gpu/drm/arc/arcpgu_hdmi.c +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * ARC PGU DRM driver. - * - * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com) - */ - -#include -#include -#include -#include - -#include "arcpgu.h" - -int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np) -{ - struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm); - struct drm_bridge *bridge; - - /* Locate drm bridge from the hdmi encoder DT node */ - bridge = of_drm_find_bridge(np); - if (!bridge) - return -EPROBE_DEFER; - - /* Link drm_bridge to encoder */ - return drm_simple_display_pipe_attach_bridge(&arcpgu->pipe, bridge); -}