lkml.org 
[lkml]   [2014]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 01/14] HID: uHID: remove duplicated code
Date
uhid_hid_output_report() can be implemented through a simple call
to uhid_hid_output_raw().

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/hid/uhid.c | 22 +---------------------
1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index 12439e1..b6de903 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -247,27 +247,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 = {
--
1.8.3.1


\
 
 \ /
  Last update: 2014-02-10 20:21    [W:0.121 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site