Skip to content

Commit

Permalink
HID: asus: Add hid_is_using_ll_driver(usb_hid_driver) check
Browse files Browse the repository at this point in the history
Add a hid_is_using_ll_driver(usb_hid_driver) check to ensure that the
parent device is an usb_interface, before casting the parent device
pointer to an usb_interface pointer with to_usb_interface().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
jwrdegoede authored and Jiri Kosina committed May 6, 2020
1 parent a80b2f3 commit 4bc43a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-asus.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (drvdata->quirks & QUIRK_IS_MULTITOUCH)
drvdata->tp = &asus_i2c_tp;

if (drvdata->quirks & QUIRK_T100_KEYBOARD) {
if ((drvdata->quirks & QUIRK_T100_KEYBOARD) &&
hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);

if (intf->altsetting->desc.bInterfaceNumber == T100_TPAD_INTF) {
Expand Down

0 comments on commit 4bc43a4

Please sign in to comment.