From: Benjamin Tissoires Date: Mon, 10 Feb 2014 17:58:46 +0000 (-0500) Subject: HID: uHID: remove duplicated code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=41abfb36005e06276a38fdda9ba4162d2a134c54;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git HID: uHID: remove duplicated code uhid_hid_output_report() can be implemented through a simple call to uhid_hid_output_raw(). Signed-off-by: Benjamin Tissoires Reviewed-by: David Herrmann Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 89de2fef46b2..49fbe97ebb16 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -164,27 +164,7 @@ static int uhid_hid_output_raw(struct hid_device *hid, __u8 *buf, size_t count, static int uhid_hid_output_report(struct hid_device *hid, __u8 *buf, size_t count) { - struct uhid_device *uhid = hid->driver_data; - unsigned long flags; - struct uhid_event *ev; - - if (count < 1 || count > UHID_DATA_MAX) - return -EINVAL; - - ev = kzalloc(sizeof(*ev), GFP_KERNEL); - if (!ev) - return -ENOMEM; - - ev->type = UHID_OUTPUT; - ev->u.output.size = count; - ev->u.output.rtype = UHID_OUTPUT_REPORT; - memcpy(ev->u.output.data, buf, count); - - spin_lock_irqsave(&uhid->qlock, flags); - uhid_queue(uhid, ev); - spin_unlock_irqrestore(&uhid->qlock, flags); - - return count; + return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT); } static struct hid_ll_driver uhid_hid_driver = {