[DIGImend-devel] [PATCH 1/2] uclogic: factor out uclogic_append_suffix
Brought to you by:
spb_nick
|
From: Benjamin T. <ben...@re...> - 2015-03-17 13:13:31
|
.input_configured() will be used to make the device appear like a Wacom
tablet. We need to have a separate call for appending the suffix to keep
the code clear.
---
Not sure this one needs to go upstream. It's only required for the next patch
which should not go upstream.
hid-uclogic.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hid-uclogic.c b/hid-uclogic.c
index cca77d8..e7ea0e3 100644
--- a/hid-uclogic.c
+++ b/hid-uclogic.c
@@ -753,18 +753,13 @@ static int uclogic_input_mapping(struct hid_device *hdev, struct hid_input *hi,
return 0;
}
-static void uclogic_input_configured(struct hid_device *hdev,
- struct hid_input *hi)
+static void uclogic_append_suffix(struct hid_device *hdev, struct hid_input *hi)
{
char *name;
const char *suffix = NULL;
struct hid_field *field;
size_t len;
- /* no report associated (HID_QUIRK_MULTI_INPUT not set) */
- if (!hi->report)
- return;
-
field = hi->report->field[0];
switch (field->application) {
@@ -798,6 +793,17 @@ static void uclogic_input_configured(struct hid_device *hdev,
}
}
+static void uclogic_input_configured(struct hid_device *hdev,
+ struct hid_input *hi)
+{
+ /* no report associated (HID_QUIRK_MULTI_INPUT not set) */
+ if (!hi->report)
+ return;
+
+ uclogic_append_suffix(hdev, hi);
+
+}
+
/**
* Enable fully-functional tablet mode and determine device parameters.
*
--
2.3.1
|