Re: [PATCH v2] HID: i2c-hid: add mutex protecting open/close race

2012-12-12 Thread Jiri Kosina
On Wed, 12 Dec 2012, Benjamin Tissoires wrote: > 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 >

[PATCH v2] HID: i2c-hid: add mutex protecting open/close race

2012-12-12 Thread Benjamin Tissoires
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 Reviewed-by: Jean Delvare --- Changes in v2: * add mutex.h Ch