HID: i2c-hid: add mutex protecting open/close race
HID: i2c-hid: add mutex protecting open/close race

We should not enter close function while someone else is in open.
This mutex prevents this race.

There is also no need to override the ret value with -EIO in case of
a failure of i2c_hid_set_power.

Signed-off-by: Benjamin Tissoires <7a0e50e3f6a0939db82b6a8a423c08a163896f41@gmail.com>
Reviewed-by: Jean Delvare <49ad6a9f5aa17024c23048df346d55bda6837e01@linux-fr.org>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs