diff options
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 017fc20167d4..3dacbcd7e41c 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -648,6 +648,9 @@ int hid_parse_report(struct hid_device *device, __u8 *start, | |||
648 | hid_parser_reserved | 648 | hid_parser_reserved |
649 | }; | 649 | }; |
650 | 650 | ||
651 | if (device->driver->report_fixup) | ||
652 | device->driver->report_fixup(device, start, size); | ||
653 | |||
651 | device->rdesc = kmalloc(size, GFP_KERNEL); | 654 | device->rdesc = kmalloc(size, GFP_KERNEL); |
652 | if (device->rdesc == NULL) | 655 | if (device->rdesc == NULL) |
653 | return -ENOMEM; | 656 | return -ENOMEM; |
@@ -1152,15 +1155,20 @@ static int hid_device_probe(struct device *dev) | |||
1152 | int ret = 0; | 1155 | int ret = 0; |
1153 | 1156 | ||
1154 | if (!hdev->driver) { | 1157 | if (!hdev->driver) { |
1155 | if (hdrv->probe) { | 1158 | id = hid_match_id(hdev, hdrv->id_table); |
1156 | ret = -ENODEV; | 1159 | if (id == NULL) |
1160 | return -ENODEV; | ||
1157 | 1161 | ||
1158 | id = hid_match_id(hdev, hdrv->id_table); | 1162 | hdev->driver = hdrv; |
1159 | if (id) | 1163 | if (hdrv->probe) { |
1160 | ret = hdrv->probe(hdev, id); | 1164 | ret = hdrv->probe(hdev, id); |
1165 | } else { /* default probe */ | ||
1166 | ret = hid_parse(hdev); | ||
1167 | if (!ret) | ||
1168 | ret = hid_hw_start(hdev); | ||
1161 | } | 1169 | } |
1162 | if (!ret) | 1170 | if (ret) |
1163 | hdev->driver = hdrv; | 1171 | hdev->driver = NULL; |
1164 | } | 1172 | } |
1165 | return ret; | 1173 | return ret; |
1166 | } | 1174 | } |
@@ -1173,6 +1181,8 @@ static int hid_device_remove(struct device *dev) | |||
1173 | if (hdrv) { | 1181 | if (hdrv) { |
1174 | if (hdrv->remove) | 1182 | if (hdrv->remove) |
1175 | hdrv->remove(hdev); | 1183 | hdrv->remove(hdev); |
1184 | else /* default remove */ | ||
1185 | hid_hw_stop(hdev); | ||
1176 | hdev->driver = NULL; | 1186 | hdev->driver = NULL; |
1177 | } | 1187 | } |
1178 | 1188 | ||