From 6cc90ccd4f6cfed98e2a3a378debc69f28d57473 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Fri, 18 Nov 2022 09:42:54 +0100 Subject: HID: fix BT_HIDP Kconfig dependencies If HID_SUPPORT is not selected, BT_HIDP should not be available, simply because we disallowed the HID bus entirely. Add a new depends and actually revert this file back to where it was 10 years ago before it was changed by commit 1f41a6a99476 ("HID: Fix the generic Kconfig options"). Fixes: 25621bcc8976 ("HID: Kconfig: split HID support and hid-core compilation") Reported-by: kernel test robot Link: https://lore.kernel.org/r/202211181514.fLhaiS7o-lkp@intel.com/ Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- net/bluetooth/hidp/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') diff --git a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig index 14100f341f33..6746be07e222 100644 --- a/net/bluetooth/hidp/Kconfig +++ b/net/bluetooth/hidp/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config BT_HIDP tristate "HIDP protocol support" - depends on BT_BREDR && INPUT + depends on BT_BREDR && INPUT && HID_SUPPORT select HID help HIDP (Human Interface Device Protocol) is a transport layer -- cgit v1.2.3 From 9e3c2efcae8e5bb220b3ebfde5e27d40b96314c2 Mon Sep 17 00:00:00 2001 From: Thomas Weißschuh Date: Thu, 22 Dec 2022 05:10:49 +0000 Subject: HID: Unexport struct hidp_hid_driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As there are no external users this implementation detail does not need to be exported. Signed-off-by: Thomas Weißschuh Reviewed-by: David Rheinsberg Reviewed-by: Hans de Goede Signed-off-by: Jiri Kosina --- include/linux/hid.h | 1 - net/bluetooth/hidp/core.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'net') diff --git a/include/linux/hid.h b/include/linux/hid.h index 95ce9eec2157..c8a77b6c7985 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -856,7 +856,6 @@ struct hid_ll_driver { }; extern struct hid_ll_driver i2c_hid_ll_driver; -extern struct hid_ll_driver hidp_hid_driver; extern bool hid_is_usb(const struct hid_device *hdev); diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index cc20e706c639..c4a741f6ed5c 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -739,7 +739,7 @@ static void hidp_stop(struct hid_device *hid) hid->claimed = 0; } -struct hid_ll_driver hidp_hid_driver = { +static struct hid_ll_driver hidp_hid_driver = { .parse = hidp_parse, .start = hidp_start, .stop = hidp_stop, @@ -748,7 +748,6 @@ struct hid_ll_driver hidp_hid_driver = { .raw_request = hidp_raw_request, .output_report = hidp_output_report, }; -EXPORT_SYMBOL_GPL(hidp_hid_driver); /* This function sets up the hid device. It does not add it to the HID system. That is done in hidp_add_connection(). */ -- cgit v1.2.3 From 52d22534690446d1f4b45436b570f77df3e855ba Mon Sep 17 00:00:00 2001 From: Thomas Weißschuh Date: Thu, 22 Dec 2022 05:10:51 +0000 Subject: HID: Make lowlevel driver structs const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing is nor should be modifying these structs so mark them as const. Signed-off-by: Thomas Weißschuh Reviewed-by: David Rheinsberg Reviewed-by: Hans de Goede Signed-off-by: Jiri Kosina --- drivers/hid/i2c-hid/i2c-hid-core.c | 2 +- drivers/hid/uhid.c | 2 +- drivers/hid/usbhid/hid-core.c | 2 +- include/linux/hid.h | 2 +- net/bluetooth/hidp/core.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'net') diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index fc5a0dd4eb92..af98ac31c8d4 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -842,7 +842,7 @@ static void i2c_hid_close(struct hid_device *hid) clear_bit(I2C_HID_STARTED, &ihid->flags); } -static struct hid_ll_driver i2c_hid_ll_driver = { +static const struct hid_ll_driver i2c_hid_ll_driver = { .parse = i2c_hid_parse, .start = i2c_hid_start, .stop = i2c_hid_stop, diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 6cec0614fc98..f161c95a1ad2 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -387,7 +387,7 @@ static int uhid_hid_output_report(struct hid_device *hid, __u8 *buf, return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT); } -static struct hid_ll_driver uhid_hid_driver = { +static const struct hid_ll_driver uhid_hid_driver = { .start = uhid_hid_start, .stop = uhid_hid_stop, .open = uhid_hid_open, diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 4143bab3380a..257dd73e37bf 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1318,7 +1318,7 @@ static bool usbhid_may_wakeup(struct hid_device *hid) return device_may_wakeup(&dev->dev); } -static struct hid_ll_driver usb_hid_driver = { +static const struct hid_ll_driver usb_hid_driver = { .parse = usbhid_parse, .start = usbhid_start, .stop = usbhid_stop, diff --git a/include/linux/hid.h b/include/linux/hid.h index 620ae99fb166..3922b66c6da8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -596,7 +596,7 @@ struct hid_device { /* device report descriptor */ struct device dev; /* device */ struct hid_driver *driver; - struct hid_ll_driver *ll_driver; + const struct hid_ll_driver *ll_driver; struct mutex ll_open_lock; unsigned int ll_open_count; diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index c4a741f6ed5c..bed1a7b9205c 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -739,7 +739,7 @@ static void hidp_stop(struct hid_device *hid) hid->claimed = 0; } -static struct hid_ll_driver hidp_hid_driver = { +static const struct hid_ll_driver hidp_hid_driver = { .parse = hidp_parse, .start = hidp_start, .stop = hidp_stop, -- cgit v1.2.3