From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759855AbdAKPkt (ORCPT ); Wed, 11 Jan 2017 10:40:49 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:51562 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932473AbdAKPjS (ORCPT ); Wed, 11 Jan 2017 10:39:18 -0500 From: Arnd Bergmann To: Andrew Duggan Cc: Dmitry Torokhov , Christopher Heiny , Nick Dyer , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires , Lyude Paul Subject: Re: [PATCH] Input: synaptics-rmi4 - make F03 a tristate symbol Date: Wed, 11 Jan 2017 16:39:07 +0100 Message-ID: <4257703.BL932J6KbN@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <20170110121718.2992211-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:2fQzUr+81GRuauuLE+OYzI1dQx42BtoXthzee8y6QrtKTMZVPx3 VkHzM6rVkrXnnQhgPxeVyvvB/twJxVHLiKJeeEB+aQ/Adb6BNjhtuH1V/i6pL/RNtBSKOCB uelixaCCcrI2ZdcTDDOFm9KzntEQYbHu4mhO6u9ku72qTGyRZe2sKoU+LiM/WBkCrGA9kGW Tu9HQ0LUb7lkuu44qJEhg== X-UI-Out-Filterresults: notjunk:1;V01:K0:hg4+c+vGIqk=:lcU9OqomTombnMDaQe/LXR LWiqSl//ZeDZfmWlO05gza/pTmBPhjGttDnnrbqpm404VOreJcccHsTk+lYbNtrpqjpb8ZaxY dvdqRkYMYDNyx/VdGwxBoCe91I4OVyUwUYE3JbAEAfBGhTotZo8xZoDZHmol7Ls/5sGlhBURv uyQlfR5rkMcSy97KhBgiQq+yvnXid2BHntfURUK2mgUUb3e1AZZNC+5djYDNL6CN69O+BEqQk DKBMbFLSme49kGTpNm+sEjL7CNJAms7teV9ex18Uv5wUQXp0lOVqLeXunakIcvHDCilGsGn1b gH2tLS/+BMuWGDsYK43mKEn/amp+AnDk+T6l2dAloIXK/8o8CepO4S3XMSosdlMXJ3sB7xjHr DThOW1zP9J0vZrnvN2zT/2uGRRbCtnjzvX3lGyGsayO0KpB3DGanuczNcKsgqUagoBNXS6uAR ISCLW2kxlqeobzcaCGxJXGlqdM6YqBQoRY95gSanovk9jETwDVRYJ7hNsX7twkL1ARAIM7/pl 19iQsgHftnl3l2QH1YEAZKCC1YOIanKOEaoX2d8Pl7Z3/cT4W9XHC9fjyHI68uehPotQC32DE VRlALBeFOiG6m+KYnsB/FjscucwRSsqvhUtp4LeTHRq7JqRcApciznNdsj+PNdZe6i2EthNPk 2ljCfWvhzWILhx5yiAv6JXyAC4fmT+jTVbf6p3rMIYYgxp9Do9jo/ie+G1sDO0ymmx9c4iLJ0 MT8cxzts34tSxFym Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, January 10, 2017 4:39:43 PM CET Andrew Duggan wrote: > On 01/10/2017 04:16 AM, Arnd Bergmann wrote: > > If CONFIG_INPUT=m, we get a build error for the rmi4-f03 driver, > > added in linux-4.10: > > > > drivers/input/built-in.o: In function `rmi_f03_attention': > > rmi_f03.c:(.text+0xcfe0): undefined reference to `serio_interrupt' > > rmi_f03.c:(.text+0xd055): undefined reference to `serio_interrupt' > > drivers/input/built-in.o: In function `rmi_f03_remove': > > rmi_f03.c:(.text+0xd115): undefined reference to `serio_unregister_port' > > drivers/input/built-in.o: In function `rmi_f03_probe': > > rmi_f03.c:(.text+0xd209): undefined reference to `__serio_register_port' > > > > If we make the driver itself a 'tristate' instead of 'bool' symbol, > > Kconfig ensures that it can only be a loadable module in this case, > > which avoids the problem. > > Unfortunately, the RMI4 driver does not support building the function > drivers as modules. If F03 is built as a module it will not be loaded by > the core. If we want f03 to be part of a module then rmi_core needs to > be built as a module. We should remove the module macros currently in > rmi_f03.c. > > I was able to get a similar build error by setting CONFIG_RMI_CORE=y and > CONFIG_SERIO=m. Was CONFIG_RMI_CORE=y set when you encountered this > error? If so I think we should figure out a way to have Kconfig set > CONFIG_RMI_CORE=m if serio is built as a module. Ok, I see what you mean now in static struct rmi_function_handler *fn_handlers[] = { &rmi_f01_handler, #ifdef CONFIG_RMI4_F03 &rmi_f03_handler, #endif #ifdef CONFIG_RMI4_F11 &rmi_f11_handler, #endif ... }; I think we can actually make this more modular and more like other drivers work: If each of the sub-drivers gets changed to call rmi_register_function_handler() on its own handler structure, having some drivers as modules would just work. It looks like the rmi_bus.c file was written to do it that way, but for some reason the references to those drivers are all in the same file. Arnd