Skip to content

Commit ac203cd

Browse files
Sandeep C SJiri Kosina
authored andcommitted
HID: samsung: Broaden device compatibility in samsung driver
The USB validation check has been moved wherever its required. Earlier Samsung driver only handles USB HID devices and returns an error if it encounters a Bluetooth type of HID device. This changes improves driver compatibility and extends its support for a wide range of devices. Signed-off-by: Sandeep C S <[email protected]> Signed-off-by: Junwan Cho <[email protected]> Signed-off-by: Jitender Sajwan <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent fef018d commit ac203cd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/hid/hid-samsung.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
128128
static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
129129
unsigned int *rsize)
130130
{
131-
if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product)
131+
if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product && hid_is_usb(hdev))
132132
rdesc = samsung_irda_report_fixup(hdev, rdesc, rsize);
133133
return rdesc;
134134
}
@@ -139,7 +139,7 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
139139
{
140140
int ret = 0;
141141

142-
if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product)
142+
if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product && hid_is_usb(hdev))
143143
ret = samsung_kbd_mouse_input_mapping(hdev,
144144
hi, field, usage, bit, max);
145145

@@ -152,16 +152,17 @@ static int samsung_probe(struct hid_device *hdev,
152152
int ret;
153153
unsigned int cmask = HID_CONNECT_DEFAULT;
154154

155-
if (!hid_is_usb(hdev))
156-
return -EINVAL;
157-
158155
ret = hid_parse(hdev);
159156
if (ret) {
160157
hid_err(hdev, "parse failed\n");
161158
goto err_free;
162159
}
163160

164161
if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product) {
162+
if (!hid_is_usb(hdev)) {
163+
ret = -EINVAL;
164+
goto err_free;
165+
}
165166
if (hdev->rsize == 184) {
166167
/* disable hidinput, force hiddev */
167168
cmask = (cmask & ~HID_CONNECT_HIDINPUT) |

0 commit comments

Comments
 (0)