forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/staging/greybus/hid.c
....@@ -12,8 +12,7 @@
1212 #include <linux/module.h>
1313 #include <linux/mutex.h>
1414 #include <linux/slab.h>
15
-
16
-#include "greybus.h"
15
+#include <linux/greybus.h>
1716
1817 /* Greybus HID device's structure */
1918 struct gb_hid {
....@@ -49,8 +48,8 @@
4948 return ret;
5049
5150 ret = gb_operation_sync(ghid->connection, GB_HID_TYPE_GET_REPORT_DESC,
52
- NULL, 0, rdesc,
53
- le16_to_cpu(ghid->hdesc.wReportDescLength));
51
+ NULL, 0, rdesc,
52
+ le16_to_cpu(ghid->hdesc.wReportDescLength));
5453
5554 gb_pm_runtime_put_autosuspend(ghid->bundle);
5655
....@@ -86,7 +85,7 @@
8685 request.report_id = report_id;
8786
8887 ret = gb_operation_sync(ghid->connection, GB_HID_TYPE_GET_REPORT,
89
- &request, sizeof(request), buf, len);
88
+ &request, sizeof(request), buf, len);
9089
9190 gb_pm_runtime_put_autosuspend(ghid->bundle);
9291
....@@ -211,11 +210,13 @@
211210 struct hid_report *report;
212211
213212 list_for_each_entry(report,
214
- &hid->report_enum[HID_INPUT_REPORT].report_list, list)
213
+ &hid->report_enum[HID_INPUT_REPORT].report_list,
214
+ list)
215215 gb_hid_init_report(ghid, report);
216216
217217 list_for_each_entry(report,
218
- &hid->report_enum[HID_FEATURE_REPORT].report_list, list)
218
+ &hid->report_enum[HID_FEATURE_REPORT].report_list,
219
+ list)
219220 gb_hid_init_report(ghid, report);
220221 }
221222
....@@ -259,8 +260,8 @@
259260 }
260261
261262 static int gb_hid_raw_request(struct hid_device *hid, unsigned char reportnum,
262
- __u8 *buf, size_t len, unsigned char rtype,
263
- int reqtype)
263
+ __u8 *buf, size_t len, unsigned char rtype,
264
+ int reqtype)
264265 {
265266 switch (reqtype) {
266267 case HID_REQ_GET_REPORT:
....@@ -289,10 +290,8 @@
289290 }
290291
291292 rdesc = kzalloc(rsize, GFP_KERNEL);
292
- if (!rdesc) {
293
- dbg_hid("couldn't allocate rdesc memory\n");
293
+ if (!rdesc)
294294 return -ENOMEM;
295
- }
296295
297296 ret = gb_hid_get_report_desc(ghid, rdesc);
298297 if (ret) {
....@@ -440,7 +439,7 @@
440439 return -ENOMEM;
441440
442441 connection = gb_connection_create(bundle, le16_to_cpu(cport_desc->id),
443
- gb_hid_request_handler);
442
+ gb_hid_request_handler);
444443 if (IS_ERR(connection)) {
445444 ret = PTR_ERR(connection);
446445 goto err_free_ghid;