HID: i2c-hid: reorder allocation/free of buffers
authorBenjamin Tissoires <benjamin.tissoires@gmail.com>
Wed, 5 Dec 2012 14:02:54 +0000 (15:02 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 6 Dec 2012 09:55:15 +0000 (10:55 +0100)
commit29b45787d1f57f82a1c37ff5a47786c6a9dbedd8
treef274b7f44c266934d25265841ad15df0502cfd8e
parent27174cff8fcfcb3a60a3e7225cc627f6a4b7f827
HID: i2c-hid: reorder allocation/free of buffers

Simplifies i2c_hid_alloc_buffers tests, and makes this function
responsible of the assignment of ihid->bufsize.
The condition for the reallocation in i2c_hid_start is then simpler.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid.c