From patchwork Thu Dec 22 05:10:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 636924 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2579C41535 for ; Thu, 22 Dec 2022 05:10:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234829AbiLVFKz (ORCPT ); Thu, 22 Dec 2022 00:10:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiLVFKw (ORCPT ); Thu, 22 Dec 2022 00:10:52 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12ACD1705E; Wed, 21 Dec 2022 21:10:50 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671685847; bh=+TwYUhNEMciEbKy4LBuWCzsBr/FmeYPjRzvFbPwU3T0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dkHGyX+F319hDFe8JREAbJkgVdPhAr4CDz63BQACf6YbFBNMSaW7heWcM4okGjKAG OBKf9L99sesfe+Ip0v+vT3Q8tzrBjLPSxIYbFSG8JJVBMuF53J+cPWhdZ5zp82kOSl LZ3pBptvCET0wdj8JRs4FopuKnYTOapc1polxjus= Date: Thu, 22 Dec 2022 05:10:44 +0000 Subject: [PATCH 1/8] HID: letsketch: Use hid_is_usb() MIME-Version: 1.0 Message-Id: <20221222-hid-v1-1-f4a6c35487a5@weissschuh.net> References: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> In-Reply-To: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> To: Hans de Goede , Jiri Kosina , Benjamin Tissoires , David Rheinsberg , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671685844; l=678; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=+TwYUhNEMciEbKy4LBuWCzsBr/FmeYPjRzvFbPwU3T0=; b=ez9SDwFeWSSaEcM4FNhQ2nLrcWuyDgqqhikUkJqh92wXbyM7rYsccOS2kygfF76KfaUeMS6jE1Iz ZglXQ5nOBeq8iiv0o2fqnHwdmsPPpSmbESbRSY99mMGlo0AQyMBT X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Don't open code existing functionality. Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-letsketch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-letsketch.c b/drivers/hid/hid-letsketch.c index 74d17cf518ba..97f047f18136 100644 --- a/drivers/hid/hid-letsketch.c +++ b/drivers/hid/hid-letsketch.c @@ -238,7 +238,7 @@ static int letsketch_probe(struct hid_device *hdev, const struct hid_device_id * char buf[256]; int i, ret; - if (!hid_is_using_ll_driver(hdev, &usb_hid_driver)) + if (!hid_is_usb(hdev)) return -ENODEV; intf = to_usb_interface(hdev->dev.parent); From patchwork Thu Dec 22 05:10:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 636922 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B884C4332F for ; Thu, 22 Dec 2022 05:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234872AbiLVFLK (ORCPT ); Thu, 22 Dec 2022 00:11:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234973AbiLVFK5 (ORCPT ); Thu, 22 Dec 2022 00:10:57 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E42F178A5; Wed, 21 Dec 2022 21:10:55 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671685848; bh=FtucXeOqhf/uwSmZUOmwGhFgKFDCA9qaKfFhVklXs0M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YHzejwL7SuWZwjrhLR4DKptcjvIT0orp+tF+YwprS6dypbmp5pN0ErmSymXZ8rHaq b8qEunKXylgKdVCial+uCfm7rLoNo7q8xzz45BIpWTtgePfpw4VyOgJVJvCkOwN+9g yQ/FHPfOZM2uuJfFqb6bSYCIuDa3BOIqIjvhYnd4= Date: Thu, 22 Dec 2022 05:10:45 +0000 Subject: [PATCH 2/8] HID: usbhid: Make hid_is_usb() non-inline MIME-Version: 1.0 Message-Id: <20221222-hid-v1-2-f4a6c35487a5@weissschuh.net> References: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> In-Reply-To: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> To: Hans de Goede , Jiri Kosina , Benjamin Tissoires , David Rheinsberg , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671685845; l=1506; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=FtucXeOqhf/uwSmZUOmwGhFgKFDCA9qaKfFhVklXs0M=; b=UB9Y4WcNg/MqRsY8fH/mjN2XW796kfEfNDKTuo1LtScaZE8nN1kABWW19n6EWmxAjQoUxpyFCdsW iDklWEpCCfNE5urMvYanl8sjuNuTpr5lCp+bnHJVX94T5Pje9X+N X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org By making hid_is_usb() a non-inline function the lowlevel usbhid driver does not have to be exported anymore. Also mark the argument as const as it is not modified. Signed-off-by: Thomas Weißschuh --- drivers/hid/usbhid/hid-core.c | 6 ++++++ include/linux/hid.h | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index be4c731aaa65..54b0280d0073 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1334,6 +1334,12 @@ struct hid_ll_driver usb_hid_driver = { }; EXPORT_SYMBOL_GPL(usb_hid_driver); +bool hid_is_usb(const struct hid_device *hdev) +{ + return hdev->ll_driver == &usb_hid_driver; +} +EXPORT_SYMBOL_GPL(hid_is_usb); + static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_host_interface *interface = intf->cur_altsetting; diff --git a/include/linux/hid.h b/include/linux/hid.h index 8677ae38599e..e8400aa78522 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -864,10 +864,7 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev, return hdev->ll_driver == driver; } -static inline bool hid_is_usb(struct hid_device *hdev) -{ - return hid_is_using_ll_driver(hdev, &usb_hid_driver); -} +extern bool hid_is_usb(const struct hid_device *hdev); #define PM_HINT_FULLON 1<<5 #define PM_HINT_NORMAL 1<<1 From patchwork Thu Dec 22 05:10:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 636921 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46225C46467 for ; Thu, 22 Dec 2022 05:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235046AbiLVFLN (ORCPT ); Thu, 22 Dec 2022 00:11:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234968AbiLVFK5 (ORCPT ); Thu, 22 Dec 2022 00:10:57 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D39217067; Wed, 21 Dec 2022 21:10:55 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671685848; bh=aJ7IVJ34rJu4bypYe1rv5vqdZ+Bmi73wBdQLIivw4ts=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nzvPq4V4YM3yepefWrKQUEa+Nby91i6BGB4MbAPtZ9zCehBQTP7ZpumFTXCngMTPy b/oKA3a98bIv/t3N+WjrRDOIWjX0AM5Bteqs1FSAEd1sR+WrLz4MJY0m4sqxC8tKlc 3jCIbs3NbFjQ/GhUp0eDBxj0UZWf7KtbgF29MyM4= Date: Thu, 22 Dec 2022 05:10:46 +0000 Subject: [PATCH 3/8] HID: Remove unused function hid_is_using_ll_driver() MIME-Version: 1.0 Message-Id: <20221222-hid-v1-3-f4a6c35487a5@weissschuh.net> References: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> In-Reply-To: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> To: Hans de Goede , Jiri Kosina , Benjamin Tissoires , David Rheinsberg , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671685845; l=761; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=aJ7IVJ34rJu4bypYe1rv5vqdZ+Bmi73wBdQLIivw4ts=; b=CO/ajOHSL68RVBZncIxSRsKPvD1NB0gAon57+ErnZ3WV+3ZsBndBhdn4vhj39QQXFDdBmKBW3Fnl n/fw2GoHClUGZswPDlzct7sDSUC125wbm+rYgxjPxpSxQNl9uN37 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org As the last user was removed we can delete this function. Signed-off-by: Thomas Weißschuh --- include/linux/hid.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/linux/hid.h b/include/linux/hid.h index e8400aa78522..7c5fce6a189e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -858,12 +858,6 @@ extern struct hid_ll_driver hidp_hid_driver; extern struct hid_ll_driver uhid_hid_driver; extern struct hid_ll_driver usb_hid_driver; -static inline bool hid_is_using_ll_driver(struct hid_device *hdev, - struct hid_ll_driver *driver) -{ - return hdev->ll_driver == driver; -} - extern bool hid_is_usb(const struct hid_device *hdev); #define PM_HINT_FULLON 1<<5 From patchwork Thu Dec 22 05:10:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 636202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1C1DC4332F for ; Thu, 22 Dec 2022 05:10:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234459AbiLVFKy (ORCPT ); Thu, 22 Dec 2022 00:10:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230417AbiLVFKw (ORCPT ); Thu, 22 Dec 2022 00:10:52 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12268165B2; Wed, 21 Dec 2022 21:10:50 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671685848; bh=RIY1KZguWJeqHeg13Dbz3EKLW3n5Yawly4C6fJX/LRo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=B4KopxcGDKneLhdAvB+atbk/GeTqzo6ATdvLeucyapM3W/3YYRA4GH5o+Aa+jUqvr DsyaescBu1lPdwZen5tz3kT2577Fh2cp5C3B75c5tTBQfFMdE6YSMkbudcV3v/42nf 0mRODCEI7Tom4lYQPSvqzdcZijSAf7VZXJ4NEWcs= Date: Thu, 22 Dec 2022 05:10:47 +0000 Subject: [PATCH 4/8] HID: Unexport struct usb_hid_driver MIME-Version: 1.0 Message-Id: <20221222-hid-v1-4-f4a6c35487a5@weissschuh.net> References: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> In-Reply-To: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> To: Hans de Goede , Jiri Kosina , Benjamin Tissoires , David Rheinsberg , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671685845; l=1454; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=RIY1KZguWJeqHeg13Dbz3EKLW3n5Yawly4C6fJX/LRo=; b=Twlbh9MUsolPC82vCzevu0rgTC04hHdXtPIymvu1dlWN4lhliG2xZcHHYVBpMH7XO1SMuEjKKlp7 hpKtj9u4C3bfXOpPLVvR2NF9tVYHgzvL6IRNjQZRixgb8yX4EhSl X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org As no external users remain this implementation detail does not need to be exported anymore. Signed-off-by: Thomas Weißschuh --- drivers/hid/usbhid/hid-core.c | 3 +-- include/linux/hid.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 54b0280d0073..4143bab3380a 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); } -struct hid_ll_driver usb_hid_driver = { +static struct hid_ll_driver usb_hid_driver = { .parse = usbhid_parse, .start = usbhid_start, .stop = usbhid_stop, @@ -1332,7 +1332,6 @@ struct hid_ll_driver usb_hid_driver = { .idle = usbhid_idle, .may_wakeup = usbhid_may_wakeup, }; -EXPORT_SYMBOL_GPL(usb_hid_driver); bool hid_is_usb(const struct hid_device *hdev) { diff --git a/include/linux/hid.h b/include/linux/hid.h index 7c5fce6a189e..170cad696541 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 struct hid_ll_driver uhid_hid_driver; -extern struct hid_ll_driver usb_hid_driver; extern bool hid_is_usb(const struct hid_device *hdev); From patchwork Thu Dec 22 05:10:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 636923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1EABC3DA7C for ; Thu, 22 Dec 2022 05:11:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234966AbiLVFK6 (ORCPT ); Thu, 22 Dec 2022 00:10:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234939AbiLVFK4 (ORCPT ); Thu, 22 Dec 2022 00:10:56 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E34F2165B2; Wed, 21 Dec 2022 21:10:54 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671685851; bh=6D4t7+JXnsI1DZVJH2nKSPANnSWnoNUa6Jai4hAGGu0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=q5AqM4c+GY8WS6WkXYvHnj9n88nW4RLtbP/bIVz5vGdSs8bg194M4EbvKBEU34+F5 eUX/KtMRAmD3EjJtYDRO8hEBI0AOlzsvVkAI/L4duw0OhcHG4El57ywfk1T6s8PtnT PEVkRt8ZCYM/c7PiaPR1F/z+L1oXeVAw4Ff41bsY= Date: Thu, 22 Dec 2022 05:10:48 +0000 Subject: [PATCH 5/8] HID: Unexport struct uhid_hid_driver MIME-Version: 1.0 Message-Id: <20221222-hid-v1-5-f4a6c35487a5@weissschuh.net> References: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> In-Reply-To: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> To: Hans de Goede , Jiri Kosina , Benjamin Tissoires , David Rheinsberg , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671685845; l=1385; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=6D4t7+JXnsI1DZVJH2nKSPANnSWnoNUa6Jai4hAGGu0=; b=ueKsApjEc+dHlbV5vxODk6cHsdKukzb8/qpLEcck8VMUonrilUZkvyjDis9pnwrHNt9/RpmXQMV9 cQwA8HBrBT1Wf/ImQaWGcl8NtV+HDRASjrB+h5PYMZU+iR0qrbwa X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org As there are no external users this implementation detail does not need to be exported. Signed-off-by: Thomas Weißschuh --- drivers/hid/uhid.c | 3 +-- include/linux/hid.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 2a918aeb0af1..6cec0614fc98 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); } -struct hid_ll_driver uhid_hid_driver = { +static struct hid_ll_driver uhid_hid_driver = { .start = uhid_hid_start, .stop = uhid_hid_stop, .open = uhid_hid_open, @@ -396,7 +396,6 @@ struct hid_ll_driver uhid_hid_driver = { .raw_request = uhid_hid_raw_request, .output_report = uhid_hid_output_report, }; -EXPORT_SYMBOL_GPL(uhid_hid_driver); #ifdef CONFIG_COMPAT diff --git a/include/linux/hid.h b/include/linux/hid.h index 170cad696541..3fcc47a9d0e8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -855,7 +855,6 @@ struct hid_ll_driver { extern struct hid_ll_driver i2c_hid_ll_driver; extern struct hid_ll_driver hidp_hid_driver; -extern struct hid_ll_driver uhid_hid_driver; extern bool hid_is_usb(const struct hid_device *hdev); From patchwork Thu Dec 22 05:10:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 636200 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32DC0C41535 for ; Thu, 22 Dec 2022 05:11:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230014AbiLVFK7 (ORCPT ); Thu, 22 Dec 2022 00:10:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234942AbiLVFK4 (ORCPT ); Thu, 22 Dec 2022 00:10:56 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F22167EA; Wed, 21 Dec 2022 21:10:54 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671685851; bh=KNDYF1vETUCv281B3wbscifz4EYdRKLnRT85P8QGRws=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=n5IDgDSgJ5Ft1nF8p7+fU1/gjFaYNms0ca7zuYALHWWAbIhrWhLcBASZkKCvQ0947 fYurq0cMzFzNMk96ev9jnrGRWWj4bd1BF26Ct/acvIpq0JAv+fYpVvGflq5o0vNbJR rUlHKN6n/c2XGX6Smjaq1ugRhTBew55yFB8lHujg= Date: Thu, 22 Dec 2022 05:10:49 +0000 Subject: [PATCH 6/8] HID: Unexport struct hidp_hid_driver MIME-Version: 1.0 Message-Id: <20221222-hid-v1-6-f4a6c35487a5@weissschuh.net> References: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> In-Reply-To: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> To: Hans de Goede , Jiri Kosina , Benjamin Tissoires , David Rheinsberg , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671685845; l=1398; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=KNDYF1vETUCv281B3wbscifz4EYdRKLnRT85P8QGRws=; b=/j3ygvhvFnOJULkdDMIiuq/c9IGI+in3/gju7WW3oMVJqQB8gWnhTYfiOIas7RwHuyv55bC8Ja/X MPkr7wWnAOo8Xb1xC5QrYW+9yzNGJOVrbkxXKNcJN6fTqBptKkmK X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org As there are no external users this implementation detail does not need to be exported. Signed-off-by: Thomas Weißschuh --- include/linux/hid.h | 1 - net/bluetooth/hidp/core.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/hid.h b/include/linux/hid.h index 3fcc47a9d0e8..21017e1ddbdb 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -854,7 +854,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(). */ From patchwork Thu Dec 22 05:10:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 636198 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC60DC4332F for ; Thu, 22 Dec 2022 05:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235051AbiLVFLO (ORCPT ); Thu, 22 Dec 2022 00:11:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234935AbiLVFK4 (ORCPT ); Thu, 22 Dec 2022 00:10:56 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 381B31658E; Wed, 21 Dec 2022 21:10:54 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671685851; bh=3tt57RWBYX5CpuseBTCAV7ztLBfuQPQBKVNcrS3Coqo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=epcg2+BoRcWGmGGExUkIbvMK3fOGUjiEpfuFMiP5Tk8cnxTRWIzvBWidu537lLYcD XHcmWj/niC/YYxHl2d9Tp0CCnRI/ez+gg1Vk9vrfKrMDW/6mLdadFHCPQe40DB5U0f LMgI6Wat2IpMhJynmRD6LU6BVfS5HjScNkZKUq7I= Date: Thu, 22 Dec 2022 05:10:50 +0000 Subject: [PATCH 7/8] HID: Unexport struct i2c_hid_ll_driver MIME-Version: 1.0 Message-Id: <20221222-hid-v1-7-f4a6c35487a5@weissschuh.net> References: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> In-Reply-To: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> To: Hans de Goede , Jiri Kosina , Benjamin Tissoires , David Rheinsberg , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671685845; l=1468; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=3tt57RWBYX5CpuseBTCAV7ztLBfuQPQBKVNcrS3Coqo=; b=osblnINoh9h3TCBJu+R5RiGx1YADyMfECKm+DAviSnAPrv2sUjAeix34W7wZKB3wMhcCKrZ6KPas ScB0DkgNAuPTRFqHvN9l+muu7v+WUErl0i20VnRMX4+88j1EYq/f X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org As there are no external users this implementation detail does not need to be exported. Signed-off-by: Thomas Weißschuh --- drivers/hid/i2c-hid/i2c-hid-core.c | 3 +-- include/linux/hid.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index b86b62f97108..fc5a0dd4eb92 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); } -struct hid_ll_driver i2c_hid_ll_driver = { +static struct hid_ll_driver i2c_hid_ll_driver = { .parse = i2c_hid_parse, .start = i2c_hid_start, .stop = i2c_hid_stop, @@ -851,7 +851,6 @@ struct hid_ll_driver i2c_hid_ll_driver = { .output_report = i2c_hid_output_report, .raw_request = i2c_hid_raw_request, }; -EXPORT_SYMBOL_GPL(i2c_hid_ll_driver); static int i2c_hid_init_irq(struct i2c_client *client) { diff --git a/include/linux/hid.h b/include/linux/hid.h index 21017e1ddbdb..60a092150bc6 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -853,8 +853,6 @@ struct hid_ll_driver { bool (*may_wakeup)(struct hid_device *hdev); }; -extern struct hid_ll_driver i2c_hid_ll_driver; - extern bool hid_is_usb(const struct hid_device *hdev); #define PM_HINT_FULLON 1<<5 From patchwork Thu Dec 22 05:10:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 636199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3B65C4332F for ; Thu, 22 Dec 2022 05:11:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235038AbiLVFLL (ORCPT ); Thu, 22 Dec 2022 00:11:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234972AbiLVFK5 (ORCPT ); Thu, 22 Dec 2022 00:10:57 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3131743F; Wed, 21 Dec 2022 21:10:56 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671685851; bh=lmzuDjULh3kowLm3TMvFkxEVatyBx6FhtKbQzT2W7mU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=G92vc5fD4RJzAzO3nxwjQcNGLwYlPe5rQt5aoEUC4Yo5uPkn85VtzUGr7fATtFEao uJxAejwNs6/4m9WPN5CaaTGv2km78lm/0Uza7oi0s7DetP8qCgv+3gt00/NYnC6UGw N+WDQCC4KS4N8SL4GvqLAW5kV5hZxYUxfs9a4aIg= Date: Thu, 22 Dec 2022 05:10:51 +0000 Subject: [PATCH 8/8] HID: Make lowlevel driver structs const MIME-Version: 1.0 Message-Id: <20221222-hid-v1-8-f4a6c35487a5@weissschuh.net> References: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> In-Reply-To: <20221222-hid-v1-0-f4a6c35487a5@weissschuh.net> To: Hans de Goede , Jiri Kosina , Benjamin Tissoires , David Rheinsberg , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671685845; l=2830; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=lmzuDjULh3kowLm3TMvFkxEVatyBx6FhtKbQzT2W7mU=; b=TrQRzvbiBIvM2hqcwA7qpilAY+5M4CjJABKmBOKmkVq49p7hE4I+VDC3iUmLrbzWhmg2T4XH45CP y6z/aG0rDAmHo/VUlI35Tx/LuQemT+fmoDni2btjQBfTBNztHI7S X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Nothing is nor should be modifying these structs so mark them as const. Signed-off-by: Thomas Weißschuh --- 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(-) 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 60a092150bc6..39a374c7fbac 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -595,7 +595,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,