From patchwork Fri Jul 6 12:45:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141303 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3073342ljj; Fri, 6 Jul 2018 05:47:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcj9h89buCPyj75fWmoh6gsYwqo0Gq1jU3fq6dmqRGraWWqEAZ/+vPivo0UkWZtIeclRdXQ X-Received: by 2002:a17:902:9a06:: with SMTP id v6-v6mr10156091plp.21.1530881225843; Fri, 06 Jul 2018 05:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530881225; cv=none; d=google.com; s=arc-20160816; b=jd1btN0usNvb7hCLavPQpBuDi9RE/BMWhvW1/m+Bcs95s9JREvupKqa/oid/G+ZsXo CjgGZArpUyDXFj3Z4MHb97fTB9m+Ki88t1ihmjs+LpikSpSHXhVOfDbFTi8OFrtWgUw/ ysk8v1s6rQOZq7o0vYENwZQ7wVQKAC3ch3BvM0wzbER4s/F+gbXlTG0pBhwQDxYHM8IF ZPORMSm/09LL6Z8TAdeudKS5LR2ib7FjQqGjPiESW9wWQlN5pPO8rIQ3lgZoFYyJPDjH oJp+Utcl0p7rfWh7KBsAXduJBI95nKNSJQcop9MyCl6CeTjrvtXbjQLzPi875PSD2fvA DATQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=kLJj8TycUWAg0rHc7QDF6rxIt913Yg25MeEOIaEPlsY=; b=ByFoqc3FzETU4Wkb7DB/RmGVn+dGE0/ceLi7j2DbOgPKOU0YmMkA7L2oh0Rxc+MfYy +1e00f/pTW4k1WGGG01HVNLTgVFWE0c89tmEYgq81uZlS4WIRtjDscHc9OA4sQaWMd/C piB2GMS17Pj039Da2vYy2i4MNKBahS3EHiqehy+7hBv+fV5gNDvjLslA9STsxummbCKv DwIKcoZEVVvdwwf62LRHvCe0coED8Cin9ZYL2jiQi/2iBxhJx588b1XP33O1UkShRLww In21+0KqAgD8waCKUTe8EGIBZ0bYS8UijyMzdR5fwachU+M/uepSwjxPbspYAd08DEpp sXLQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1-v6si8160134pfn.285.2018.07.06.05.47.05; Fri, 06 Jul 2018 05:47:05 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933075AbeGFMrE (ORCPT + 30 others); Fri, 6 Jul 2018 08:47:04 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:48998 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932569AbeGFMrC (ORCPT ); Fri, 6 Jul 2018 08:47:02 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mfe8p-1flYUl0Fjv-00P5iG; Fri, 06 Jul 2018 14:46:32 +0200 From: Arnd Bergmann To: Maxime Ripard , David Airlie , Chen-Yu Tsai Cc: Arnd Bergmann , Hans Verkuil , Jernej Skrabec , Jonathan Liu , =?utf-8?q?Noralf_Tr=C3=B8nnes?= , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m Date: Fri, 6 Jul 2018 14:45:53 +0200 Message-Id: <20180706124628.3192421-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:c54e9PiOk7Wlim/U846paOiqpg2DfHAPPDpdahMj9m9tN5aT4YK cu+p95lUhbuyjabduuZnYLevHn2qMjpsdeuzJ/W2NubsHOeITcwSYid3kayZ7QHtZix7kHq 4wRB4hdDkk1v+JsOJLVgoe4UiGx+Lws/Z4AFxOkham2vwGr5GrBUHzmOAIT/rpYaPYCs9S/ Pi7dae3LLPwVx1nKHrR+g== X-UI-Out-Filterresults: notjunk:1; V01:K0:p4Z/arbfPhE=:VBLSnoU0vpNyqmFlElX5Cn CcJGaXtutVRnMDBW0qOzZ+pNRWW5qLR5/ZJ82iFzm8K2rqz8iwaKbYly8PWzxsQOpdqCibC7w VtKV7IKdWc4PhAWY7hk3gxxax7CO7UihJaMXh+l7Kfa+8h1GrT9aeFYXQmmVVmq8QcZjUsKU1 OQ4ou/sVBbTcgnvAlpnueRMyRIaPDNp5B0q8aVbjpFga3e0nzEx8BsUyZt24P4x9BY3SWPb8G Rcwe9W6Ct3wjPXcbmm2B1BEmzI3ENVSoZ4VdHNl8VdAtQVvPe/aRZqmfIp6ChQjX9wICtdXLx T9Et8JjZ4iInNm/4HGUJ+xVvhU+MDXJzxWBBIt8qRoVEM/WTTdtwum34tIompFDQDcfS8RfFA AJv2yLGQmLn8TwqDJVoIaCTG5rfRs7a1Ftrp6WLyesUjYBIWhhS/p25sSvaEKMFbrtxSRHN06 8WkVRXcukeIO8RRnIXMTiDnNKlpJ+VIhI21yLbjmXIwTxFsqAJ7WWYgwxGbhpWTd7C0EVUnJf 1XwklMYEt59mQvsGEoMmXMv9C2aMcPS++Rf79McWJsV4+xE4c6BdD/NKGVt7yzDnSnxtr8l/V IJN9Yg928Qb9MbiaV9qcSIpfRS8VzJ+dEhsoU/Y4YmAeLynnLQcd2ePe1SPrIU6jChaCpT3MY Fyk9a+4cRPTMpz0FqvXx1Is9Is/6/ti5EEW1wo5COqedOV5s2HTjriYbry8y+RuOgTKM= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module: ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined! ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined! This solves the problem by making DRM_SUN8I_MIXER a 'bool' symbol, building the sun8i_tcon_top module the same way as the core sun4i-drm module whenever DRM_SUN8I_MIXER is enabled, or not building it at all otherwise. Alternatively, we could always build sun8i_tcon_top.ko along with sun4-drm.ko and detach it from the mixer module, I could not tell which way is more appropriate here. Fixes: 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs") Fixes: ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/sun4i/Kconfig | 2 +- drivers/gpu/drm/sun4i/Makefile | 4 +++- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 ++- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/drivers/gpu/drm/sun4i/Kconfig b/drivers/gpu/drm/sun4i/Kconfig index 156a865c3e6d..709461deb1c0 100644 --- a/drivers/gpu/drm/sun4i/Kconfig +++ b/drivers/gpu/drm/sun4i/Kconfig @@ -60,7 +60,7 @@ config DRM_SUN8I_DW_HDMI selected the module will be called sun8i_dw_hdmi. config DRM_SUN8I_MIXER - tristate "Support for Allwinner Display Engine 2.0 Mixer" + bool "Support for Allwinner Display Engine 2.0 Mixer" default MACH_SUN8I help Choose this option if you have an Allwinner SoC with the diff --git a/drivers/gpu/drm/sun4i/Makefile b/drivers/gpu/drm/sun4i/Makefile index cd27d02c94e2..11de3cd52dae 100644 --- a/drivers/gpu/drm/sun4i/Makefile +++ b/drivers/gpu/drm/sun4i/Makefile @@ -39,4 +39,6 @@ endif obj-$(CONFIG_DRM_SUN4I_HDMI) += sun4i-drm-hdmi.o obj-$(CONFIG_DRM_SUN6I_DSI) += sun6i-dsi.o obj-$(CONFIG_DRM_SUN8I_DW_HDMI) += sun8i-drm-hdmi.o -obj-$(CONFIG_DRM_SUN8I_MIXER) += sun8i-mixer.o sun8i_tcon_top.o +ifdef CONFIG_DRM_SUN8I_MIXER +obj-$(CONFIG_DRM_SUN4I) += sun8i-mixer.o sun8i_tcon_top.o +endif diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 6ddf4eaccb40..7551dcb34c71 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -216,7 +216,8 @@ static bool sun4i_drv_node_is_tcon_with_ch0(struct device_node *node) static bool sun4i_drv_node_is_tcon_top(struct device_node *node) { - return !!of_match_node(sun8i_tcon_top_of_table, node); + return IS_ENABLED(CONFIG_DRM_SUN8I_MIXER) && + !!of_match_node(sun8i_tcon_top_of_table, node); } static int compare_of(struct device *dev, void *data) diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c index 3459b9ec56c9..b18c8f175dba 100644 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c @@ -44,7 +44,8 @@ sun8i_dw_hdmi_mode_valid(struct drm_connector *connector, static bool sun8i_dw_hdmi_node_is_tcon_top(struct device_node *node) { - return !!of_match_node(sun8i_tcon_top_of_table, node); + return IS_ENABLED(CONFIG_DRM_SUN8I_MIXER) && + !!of_match_node(sun8i_tcon_top_of_table, node); } static u32 sun8i_dw_hdmi_find_possible_crtcs(struct drm_device *drm,