From patchwork Fri Jul 6 14:28:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10511861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CFD8160325 for ; Fri, 6 Jul 2018 14:34:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C016522B27 for ; Fri, 6 Jul 2018 14:34:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4299286F7; Fri, 6 Jul 2018 14:34:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 709AE27CEE for ; Fri, 6 Jul 2018 14:34:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 995976EEF4; Fri, 6 Jul 2018 14:34:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 330 seconds by postgrey-1.36 at gabe; Fri, 06 Jul 2018 14:34:29 UTC Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id B5FD26EEF4 for ; Fri, 6 Jul 2018 14:34:29 +0000 (UTC) Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MDCnY-1fKsnO38oO-00GcH9; Fri, 06 Jul 2018 16:28:50 +0200 From: Arnd Bergmann To: Maxime Ripard , David Airlie , Chen-Yu Tsai Subject: [PATCH] [RESEND] drm/sun4i: link in front-end code if needed Date: Fri, 6 Jul 2018 16:28:28 +0200 Message-Id: <20180706142847.2032381-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:fCaH8MbrLFLFzY6/9NThH6GI7c9wvj1lmRUnFVz5arfs/O0ZERD 0CnelIfcFumZX9Qh8D9k8AflLdgtG3CZxZf/nNBWJMWqqMsx2mNdtEM6Pe04RS/I5cT45PZ 4585G7Uz292oK49AEHFOGwp1zEnC4Z4kNwSF6CUVTxvxpuxkgj0wLZ/sjHkH2Dz0LE93InJ oMPaVKE89OGgQKOu9E9Kg== X-UI-Out-Filterresults: notjunk:1; V01:K0:7pdvNDLnYWk=:XM+bK2OP3hR/Uw/VbBC3kK F5gc65umMNJmk6wsAAlctNEcrENNXzJka4zsOy16Svo1+GssiUoGLQORRD878rhmTw5TALzwO 04SM6Rr128qpsuST700HTsiejOebGw6QZBNUZhuoxULIl7YSP8A9VWYUne4CIfHt92OT9g9DP G2XJNvKounInPWlsOoFWiBmZ1OsKL7k21CfRrdNe9JR/Fa8jraYz3O4vXlyG+uO3klO5Fy9m2 eUyzShmNWIAYKu+N3hgxXXgmI4O7wq5YMwR9DfSkwUZnMRNvo0a/tviaCsZxhe4NOdyGtF6RZ Z365QuV0pLRDMGWM0hhN/OmwvbFFHS6zvmFW3VDMfH6V8oFiymCDMIA+QsYgA4htl8JUB6QXA R3MflReaS9Wu0vDdtfEzPDKXukEe1qy4pPNmUH+kEVEBjAJG/tN0K+5be1H9Ex/n+FPncQP9M BtyeygYP3fsiTTi0rFjFXbiHglSUl4JloEruCuK9ey+rLC6lfl8tigWdF2QLpdtXWQQS5Tnwn MyFdBCUV2+O0DdsgZivhq17j3ZjUaixlEP0drBq04E5RbZF7mVV+p45fzeO94kxe5q/6X3JVN AqV+c7QsgBB5V+olsYKuujjMay99mcG+Qa3kD2+KN2jUACZdUJ3K858Hz8FLPmcg32Afx6GT2 1zyR/A0TEsGdN8ZRfNoYidD8ng254pQBydMvvgiacgc8xEJdzIe2621JUcGv49ttgmvs= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jernej Skrabec , Jonathan Liu , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When the base sun4i DRM driver is built-in but the back-end is a loadable module, we run into a link error: drivers/gpu/drm/sun4i/sun4i_drv.o: In function `sun4i_drv_probe': sun4i_drv.c:(.text+0x60c): undefined reference to `sun4i_frontend_of_table' The dependency is a bit tricky, the best workaround I have come up with is to use a Makefile hack to to interpret both CONFIG_DRM_SUN4I_BACKEND=m and CONFIG_DRM_SUN4I_BACKEND=y as a directive to build the front-end the same way as the main module. Fixes: dd0421f47505 ("drm/sun4i: Add a driver for the display frontend") Link: https://lore.kernel.org/lkml/20180301091908.zcptz3ezqr2c6ly5@flea/ Signed-off-by: Arnd Bergmann --- I stumbled over this one again when I sent a related patch. --- drivers/gpu/drm/sun4i/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/Makefile b/drivers/gpu/drm/sun4i/Makefile index 3daed14941ca..11de3cd52dae 100644 --- a/drivers/gpu/drm/sun4i/Makefile +++ b/drivers/gpu/drm/sun4i/Makefile @@ -32,7 +32,10 @@ obj-$(CONFIG_DRM_SUN4I) += sun4i-tcon.o obj-$(CONFIG_DRM_SUN4I) += sun4i_tv.o obj-$(CONFIG_DRM_SUN4I) += sun6i_drc.o -obj-$(CONFIG_DRM_SUN4I_BACKEND) += sun4i-backend.o sun4i-frontend.o +obj-$(CONFIG_DRM_SUN4I_BACKEND) += sun4i-backend.o +ifdef CONFIG_DRM_SUN4I_BACKEND +obj-$(CONFIG_DRM_SUN4I) += sun4i-frontend.o +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