Skip to content

Commit 5f15dcc

Browse files
committed
Don't branch on PID in huion_report_fixup
Replace report descriptor with the one from drvdata in huion_report_fixup, regardless of the PID, as drvdata is initialized unconditionally and PID-branched report descriptor assignment is done in huion_probe already. This removes unnecessary model branching duplication, preventing future mistakes.
1 parent 68ec796 commit 5f15dcc

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

hid-huion.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,9 @@ static __u8 *huion_report_fixup(struct hid_device *hdev, __u8 *rdesc,
103103
unsigned int *rsize)
104104
{
105105
struct huion_drvdata *drvdata = hid_get_drvdata(hdev);
106-
switch (hdev->product) {
107-
case USB_DEVICE_ID_HUION_TABLET:
108-
if (drvdata->rdesc != NULL) {
109-
rdesc = drvdata->rdesc;
110-
*rsize = drvdata->rsize;
111-
}
112-
break;
106+
if (drvdata->rdesc != NULL) {
107+
rdesc = drvdata->rdesc;
108+
*rsize = drvdata->rsize;
113109
}
114110
return rdesc;
115111
}

0 commit comments

Comments
 (0)