History

HID: add hid_is_usb() function to make it simpler for USB detection

A number of HID drivers already call hid_is_using_ll_driver() but only for the detection of if this is a USB device or not. Make this more obvious by creating hid_is_usb() and calling the function that way. Also converts the existing hid_is_using_ll_driver() functions to use the new call.

Greg Kroah-Hartman committed 4 years ago

Commit f83baa01 parent 9003fbe6 files · +11 −9Browse files

Showing the changes to include/linux (1 of 6 files). Show all

Unified · Split

include/linux/hid.h+5−0
@@ -840,6 +840,11 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev, · 839 unmodified lines
840 return hdev->ll_driver == driver;840 return hdev->ll_driver == driver;
841}841}
842 842
843static inline bool hid_is_usb(struct hid_device *hdev)
844{
845 return hid_is_using_ll_driver(hdev, &usb_hid_driver);
846}
847
843#define PM_HINT_FULLON 1<<5848#define PM_HINT_FULLON 1<<5
844#define PM_HINT_NORMAL 1<<1849#define PM_HINT_NORMAL 1<<1
845 850