aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2016-01-06 14:48:11 +0530
committerDmitry Shmidt <dimitrysh@google.com>2016-01-07 13:54:13 -0800
commit9bed3bf5ed21067a3fc753315847a963d860c43e (patch)
treeed09e5e5f573a423f77b7e19831c53edadb86d77
parent2d59c614a6b6a836b0714d5bb652b7dcf63a23b9 (diff)
Revert "HID: Add input_register callback."
This reverts commit 274ba2dc1eb8d949da547743ae26178a3f83ff6b. This patch updated one of the callbacks (input_configured) but didn't update the respective drivers, so we end up running into a lot of warnings when building HID drivers. e.g. drivers/hid/hid-sony.c:2050:2: warning: initialization from incompatible pointer type [enabled by default] .input_configured = sony_input_configured, ^ ...and so on. Hence revert this patch and cherry-pick the upstream(4.4-rc1) commit 9154301a47b3 "HID: hid-input: allow input_configured callback return errors" instead. Change-Id: If417e1216a4063606cc9e1581ebd13b89880fd7a Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--drivers/hid/hid-input.c10
-rw-r--r--drivers/hid/hid-multitouch.c14
-rw-r--r--include/linux/hid.h4
3 files changed, 10 insertions, 18 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index d538ea9edb39..725f22ca47fc 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1448,9 +1448,8 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
* UGCI) cram a lot of unrelated inputs into the
* same interface. */
hidinput->report = report;
- if (drv->input_configured &&
- drv->input_configured(hid, hidinput))
- goto out_cleanup;
+ if (drv->input_configured)
+ drv->input_configured(hid, hidinput);
if (input_register_device(hidinput->input))
goto out_cleanup;
hidinput = NULL;
@@ -1471,9 +1470,8 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
}
if (hidinput) {
- if (drv->input_configured &&
- drv->input_configured(hid, hidinput))
- goto out_cleanup;
+ if (drv->input_configured)
+ drv->input_configured(hid, hidinput);
if (input_register_device(hidinput->input))
goto out_cleanup;
}
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index e6cab622fdfb..9080e3325fa5 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -711,13 +711,12 @@ static void mt_touch_report(struct hid_device *hid, struct hid_report *report)
mt_sync_frame(td, report->field[0]->hidinput->input);
}
-static int mt_touch_input_configured(struct hid_device *hdev,
+static void mt_touch_input_configured(struct hid_device *hdev,
struct hid_input *hi)
{
struct mt_device *td = hid_get_drvdata(hdev);
struct mt_class *cls = &td->mtclass;
struct input_dev *input = hi->input;
- int ret;
if (!td->maxcontacts)
td->maxcontacts = MT_DEFAULT_MAXCONTACT;
@@ -732,12 +731,9 @@ static int mt_touch_input_configured(struct hid_device *hdev,
if (cls->quirks & MT_QUIRK_NOT_SEEN_MEANS_UP)
td->mt_flags |= INPUT_MT_DROP_UNUSED;
- ret = input_mt_init_slots(input, td->maxcontacts, td->mt_flags);
- if (ret)
- return ret;
+ input_mt_init_slots(input, td->maxcontacts, td->mt_flags);
td->mt_flags = 0;
- return 0;
}
static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
@@ -891,16 +887,15 @@ static void mt_post_parse(struct mt_device *td)
cls->quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE;
}
-static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
+static void mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
{
struct mt_device *td = hid_get_drvdata(hdev);
char *name;
const char *suffix = NULL;
struct hid_field *field = hi->report->field[0];
- int ret = 0;
if (hi->report->id == td->mt_report_id)
- ret = mt_touch_input_configured(hdev, hi);
+ mt_touch_input_configured(hdev, hi);
/*
* some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
@@ -951,7 +946,6 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
hi->input->name = name;
}
}
- return ret;
}
static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 15680809d345..78ea9bf941cd 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -670,8 +670,8 @@ struct hid_driver {
int (*input_mapped)(struct hid_device *hdev,
struct hid_input *hidinput, struct hid_field *field,
struct hid_usage *usage, unsigned long **bit, int *max);
- int (*input_configured)(struct hid_device *hdev,
- struct hid_input *hidinput);
+ void (*input_configured)(struct hid_device *hdev,
+ struct hid_input *hidinput);
void (*feature_mapping)(struct hid_device *hdev,
struct hid_field *field,
struct hid_usage *usage);