HID: usbhid: Make hid_is_usb() non-inline
authorThomas Weißschuh <linux@weissschuh.net>
Thu, 22 Dec 2022 05:10:45 +0000 (05:10 +0000)
committerJiri Kosina <jkosina@suse.cz>
Tue, 17 Jan 2023 12:44:01 +0000 (13:44 +0100)
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 <linux@weissschuh.net>
Reviewed-by: David Rheinsberg <david.rheinsberg@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/hid-core.c
include/linux/hid.h

index be4c731aaa65daf68a7431f0165838c21ce0e9f7..54b0280d0073a920854d8c915a31f27105019ba8 100644 (file)
@@ -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;
index 1eb5408599cdddd0944fbb88304c28f307fb9345..c4cf9cea437727b1f820121e4c91607207b9ced3 100644 (file)
@@ -866,10 +866,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