From patchwork Tue Oct 25 09:34:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 10648 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp903063wru; Tue, 25 Oct 2022 02:37:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5dmArjmoP16MJXZtvgoSC+oudOwvnINKbFiLDvaXqLExD/IfxxcU1U1GtAH14lUT5muxib X-Received: by 2002:a05:6402:26cf:b0:45d:48d7:928e with SMTP id x15-20020a05640226cf00b0045d48d7928emr33656167edd.275.1666690670038; Tue, 25 Oct 2022 02:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666690670; cv=none; d=google.com; s=arc-20160816; b=chEnoTfbiSz5aQAStTDM/hYp8kvjDyD0o2+K/xBrMIEe4IwRbVB4eywYz4wY8a0sjJ yQZ71L9ePx+TrJuYnt6rE95nZQQlRwO4mF/yDSowDI3zPyK+X8Q8aP7gTpx+KCwI6jvP JkL7beT60x6bWtlLr0RnXrq1WtzI7eKSKlWQH4PmAJrYmCz9Uu7QIRcCxrdG1GgUrbZy LND2drYosGA06r3w0hxqNBrdPHeblciwav9Ug43RoQzrdffHC/wKz3J4L6iGNPvRwC9/ 97/knr7VHuG7K1wvim8cQLQiMsO1QAUTl0ILBNkgQMzxJlWdQrnxbZ0LoscsiTzOTgVm CxAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VGbtfkMEb8GyCHz72Cj7Hj6kcmjTcDTxFhyd1w3lCf0=; b=cvOkDGfbgNBO/zOpsmY4e+lNY34atwhcRuzsptButRYswe9uvSwT9f3sXOKqyDokcY z+Uylj7BRaUtbxr1LGtkKnlQOs75w1RXu6ukTKVfwmQutdDY27DbXNfB+Yg1Wuo1sk7h EKRAJtDF+FYK8HVI84W+YwM9GA8iRmgoY2cEFiKynkznR0MUoHXnSoDt1GyMTmnQUHTe vq4YrH+XMkvvdd86zH9jkNDuRhEyEC1BDlUH6HyfVaZrxu90x9A8XctSVTggs+LQdoJE W4MTRVf3CIoXcPV8w6dGhI1FdVj+2KsthfhKZrmai6RcdTD3hEpb8ZrNVIe3rclhEGD7 BJkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VLwmC9+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr21-20020a170907721500b0072fc714c92fsi2330175ejc.902.2022.10.25.02.37.25; Tue, 25 Oct 2022 02:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VLwmC9+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231528AbiJYJfV (ORCPT + 99 others); Tue, 25 Oct 2022 05:35:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231397AbiJYJfQ (ORCPT ); Tue, 25 Oct 2022 05:35:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D76B100431 for ; Tue, 25 Oct 2022 02:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666690511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VGbtfkMEb8GyCHz72Cj7Hj6kcmjTcDTxFhyd1w3lCf0=; b=VLwmC9+ltmt93G+xksisZuCCx3gaWP0tQpkytfGQRw7SXEn7IzsoSX0JXAwCXva6ETjB/T x2uuB3r5Oxy/slxN+nhg+KR0fG8IxEkJa6GUPMeCSvisPPQGFpuq8HxFY8nExvNlp8PHcM KAZHSBZcuVatMMKqrPBSP26hUkJw+7o= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-629-yBcCjRxGPb2AQ560Y73EQA-1; Tue, 25 Oct 2022 05:35:06 -0400 X-MC-Unique: yBcCjRxGPb2AQ560Y73EQA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A7A5185A78B; Tue, 25 Oct 2022 09:35:05 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.195.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E5C149BB65; Tue, 25 Oct 2022 09:35:03 +0000 (UTC) From: Benjamin Tissoires To: Greg KH , Jiri Kosina , Jonathan Corbet , Shuah Khan Cc: Tero Kristo , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Benjamin Tissoires Subject: [PATCH hid v11 01/14] HID: Kconfig: split HID support and hid-core compilation Date: Tue, 25 Oct 2022 11:34:45 +0200 Message-Id: <20221025093458.457089-2-benjamin.tissoires@redhat.com> In-Reply-To: <20221025093458.457089-1-benjamin.tissoires@redhat.com> References: <20221025093458.457089-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747651835766584932?= X-GMAIL-MSGID: =?utf-8?q?1747651835766584932?= Currently, we step into drivers/hid/ based on the value of CONFIG_HID. However, that value is a tristate, meaning that it can be a module. As per the documentation, if we jump into the subdirectory by following an obj-m, we can not compile anything inside that subdirectory in vmlinux. It is considered as a bug. To make things more friendly to HID-BPF, split HID (the HID core parameter) from HID_SUPPORT (do we want any kind of HID support in the system?), and make this new config a boolean. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Benjamin Tissoires --- no changes in v11 no changes in v10 no changes in v9 no changes in v8 new in v7 --- drivers/Makefile | 2 +- drivers/hid/Kconfig | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/Makefile b/drivers/Makefile index bdf1c66141c9..cf5d8b86da8f 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -137,7 +137,7 @@ obj-$(CONFIG_CRYPTO) += crypto/ obj-$(CONFIG_SUPERH) += sh/ obj-y += clocksource/ obj-$(CONFIG_DCA) += dca/ -obj-$(CONFIG_HID) += hid/ +obj-$(CONFIG_HID_SUPPORT) += hid/ obj-$(CONFIG_PPC_PS3) += ps3/ obj-$(CONFIG_OF) += of/ obj-$(CONFIG_SSB) += ssb/ diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 185a077d59cd..ad767955ee62 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -2,12 +2,18 @@ # # HID driver configuration # -menu "HID support" - depends on INPUT +menuconfig HID_SUPPORT + bool "HID bus support" + default y + depends on INPUT + help + This option adds core support for human interface device (HID). + You will also need drivers from the following menu to make use of it. + +if HID_SUPPORT config HID - tristate "HID bus support" - depends on INPUT + tristate "HID bus core support" default y help A human interface device (HID) is a type of computer device that @@ -24,8 +30,6 @@ config HID If unsure, say Y. -if HID - config HID_BATTERY_STRENGTH bool "Battery level reporting for HID devices" select POWER_SUPPLY @@ -1278,8 +1282,6 @@ config HID_KUNIT_TEST endmenu -endif # HID - source "drivers/hid/usbhid/Kconfig" source "drivers/hid/i2c-hid/Kconfig" @@ -1290,4 +1292,4 @@ source "drivers/hid/amd-sfh-hid/Kconfig" source "drivers/hid/surface-hid/Kconfig" -endmenu +endif # HID_SUPPORT