summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/u_hid.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/function/u_hid.h')
-rw-r--r--drivers/usb/gadget/function/u_hid.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/u_hid.h b/drivers/usb/gadget/function/u_hid.h
index 3edfc9567ab..aaa0e368a15 100644
--- a/drivers/usb/gadget/function/u_hid.h
+++ b/drivers/usb/gadget/function/u_hid.h
@@ -27,6 +27,13 @@ struct f_hid_opts {
unsigned short report_desc_length;
unsigned char *report_desc;
bool report_desc_alloc;
+
+ /*
+ * Protect the data form concurrent access by read/write
+ * and create symlink/remove symlink.
+ */
+ struct mutex lock;
+ int refcnt;
};
int ghid_setup(struct usb_gadget *g, int count);