Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp650371ybl; Tue, 7 Jan 2020 12:34:42 -0800 (PST) X-Google-Smtp-Source: APXvYqws+sNvFloZb8d0W6629GV/iYZhI7rDZyZBhuf4cXBL/499JP/SHWJN02c70cztZmrhXSJ8 X-Received: by 2002:aca:554d:: with SMTP id j74mr255183oib.92.1578429282222; Tue, 07 Jan 2020 12:34:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578429282; cv=none; d=google.com; s=arc-20160816; b=CkPfcEdvEd0QRQAG2b1K25GfgY5gbbcHYIttDVXaN1ESzjgQJ87y0NXUTaU0pUGs+P 9qY/5rT3kv75PKQhIQK4B0zGumV9OgBNwGUgu0j+GTyDd/RIYjBYMJ01z5a3MG+qR6Pn XVrckeTz04gXLbEhtEoI2WiwCzOPcavxoA+2s7P53ktezkfJIRGlEwmmB4h/F7Dp+IJy Bjv3hB0zbFt27TgBZg2zDs4kCag3ownN8k628ySf1iHofI8OfUGw8hRvuqPHK5b3Cc2L ApSFRHmfOOo5+xzWZlpnhVIrCEcCxiHcvT1vx6vyMUCkzBkQhRSfsroTW4zV8ESVjH4D /OYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=UIGRKo96W8WhvYHZ48xr9uqtD1wjt3nEooY8IN0NR7s=; b=tyL1qj69C/BbDpeolEzFDFp8lypg5hbkU5LlgAftCzXjsisyiqx28m0LcARDWbVt0h 9IfEfiqAsqjDCxGeszYY8Ax12W9Te2bHj1m+q0+9nkfyWkyXQxrERyK/AkOdAaEuhPYC t1kg388oEkR5MSuibfCh23VVOsfXER6PY6YU2x7poTDYk1L6oH2YTC1qBXL5kwveznUa eMFBphkuRtaRBq5N3CbejTQOT0a+ZBFK1KZ5zkGcJnoy7BRVT40FqDyEW8sXFOBWQZoB St08dVdnlLtPPNj6O3jmR7B/J3Nj8mDubQhTfPXFBXTIJS1FbVIXPAKgqoGwR+B/vzLU A4gg== 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 a205si573566oii.95.2020.01.07.12.34.28; Tue, 07 Jan 2020 12:34:42 -0800 (PST) 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 S1728634AbgAGUdM (ORCPT + 99 others); Tue, 7 Jan 2020 15:33:12 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:46835 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728358AbgAGUdM (ORCPT ); Tue, 7 Jan 2020 15:33:12 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1N8GhM-1jjtnH2mDQ-014Clh; Tue, 07 Jan 2020 21:32:35 +0100 From: Arnd Bergmann To: Maarten Lankhorst , Maxime Ripard , Thierry Reding , David Airlie , Daniel Vetter , Andy Shevchenko , Randy Dunlap , Sam Ravnborg , Linus Walleij , Laurent Pinchart Cc: Arnd Bergmann , Sean Paul , dri-devel@lists.freedesktop.org, Maxime Ripard , Emil Velikov , Boris Brezillon , Jani Nikula , linux-kernel@vger.kernel.org Subject: [PATCH] drm/drm_panel: fix export of drm_panel_of_backlight, try #3 Date: Tue, 7 Jan 2020 21:32:19 +0100 Message-Id: <20200107203231.920256-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:/NhLrxqpg6XKvAA2QlCXou9wFzS/QEKD9R22jKCGu83ingNmFkN 8MKJzffFKDqvRIrsAPk+c1QSho9DtI86Ndl/BtKD+qRSvZjghtRLKzMid8BkN6Yls7VdoNV zAmpNGWH3fEMQN2DuipIjGicyuruC2NiPTCCXC6CNomfbcKXkpQa2iOCj8LI4ZCbS00CRo6 2pHcQsagbx8cdNUjBi32Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:PEMphTNeLWo=:mweMGnIlw93YdAYqxBZoQu 7H2EeQ4t3AUCa8WHL3++FS0s6CJY7X2UnWl9g7eTvCjiqn/FB67KDtRvP4Q5xTmiZcOImAoih o1hXGbxgljwuCuRCXclzum+bMm6SuUY7ANoIQejfdTxKQriLLFMzG+C+VjRx9c23Fzk1O7NDO BmtiPqER+q/xyB+p8dEBm8rZeNEflN+l7pji2XRJaafocGfvHA6QawsH924SGJz6IouqJtPEa cFhYpNuUTBUCVQmN1v/9ieNuM95hHBQVZ0wcQl63RojxoSewN9+izIJyQp2W4eOJUBYx/7+dk Fun2yYNPSZ6WutvLqwP1Mg496/PTRU2hzsq+XtM01QNrL8dwByQviVewb0VuYJgTYWrZ5QhTW fS7ddL+1l1ZpfEHlrD2jfCfUMT+lcHIhdAyf7MxlZaijFBepm84O6bYXSflzAp4Yz8M66u00p C7u4883CF9OV7r75hZXxELrAIWKGLpWe/qJ0oFC4BnULiAW+QZ6vd0VkZnZFV1F4Y1KzMwxkf AZgT2gu3vL6IHC5e3BIcz5GGBHyG1vBEklExqXXfJpO2r3gXZ8iqcIXptrsQuntER0AiWEzVs TRBNmGY3UvYfaU9PfYCu4f4bAxGhfplLsWUxKTI92DV2WabM6lv6YSDhkQarHLeYdcvH/GbPV Mxpe4fxRKnblva+5ZN+19zUxTmVH/poabY7f1VGR+Inkq5JCkRyKO5JwK0Wph2MHNaDQe3zWj r6rtr3+3xFzBB3wwE1MG7YY0Vt7fcQZOOu+BplGWLrk6HTz9nO818HGDNIdMBQqbjlkBYXkg0 o/1xJm8WQH1jPch7Kjd9F6ym5y3JfV/RrHHRhzznzNOdvi4MwWmODvAiFHhxRphjbuICNGnSM d+4mfVH7phEBahBH4CaQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Making this IS_REACHABLE() was still wrong, as that just determines whether the lower-level backlight code would be reachable from the panel driver. However, with CONFIG_DRM=y and CONFIG_BACKLIGHT_CLASS_DEVICE=m, the drm_panel_of_backlight is left out of drm_panel.o but the condition tells the driver that it is there, leading to multiple link errors such as ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sitronix-st7701.ko] undefined! ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sharp-ls043t1le01.ko] undefined! ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-seiko-43wvf1g.ko] undefined! ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-ronbo-rb070d30.ko] undefined! ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-rocktech-jh057n00900.ko] undefined! ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.ko] undefined! ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.ko] undefined! Change the condition to check for whether the function was actually part of the drm module. This version of the patch survived a few hundred randconfig builds, so I have a good feeling this might be the last one for the export. Fixes: 4a34a9dcec94 ("drm/drm_panel: Fix EXPORT of drm_panel_of_backlight() one more time") Fixes: 907aa265fde6 ("drm/drm_panel: fix EXPORT of drm_panel_of_backlight") Fixes: 152dbdeab1b2 ("drm/panel: add backlight support") Signed-off-by: Arnd Bergmann --- include/drm/drm_panel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 121f7aabccd1..6193cb555acc 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -198,7 +198,8 @@ static inline struct drm_panel *of_drm_find_panel(const struct device_node *np) } #endif -#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE) +#if IS_ENABLED(CONFIG_DRM_PANEL) && (IS_BUILTIN(CONFIG_BACKLIGHT_CLASS_DEVICE) || \ + (IS_MODULE(CONFIG_DRM) && IS_MODULE(CONFIG_BACKLIGHT_CLASS_DEVICE))) int drm_panel_of_backlight(struct drm_panel *panel); #else static inline int drm_panel_of_backlight(struct drm_panel *panel) -- 2.20.0