aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-09-10 16:06:02 +0200
committerJohn Rigby <john.rigby@linaro.org>2011-11-16 14:23:07 -0700
commitc8f6160b079c2fc02dcd44524e2eb29665bd1b4c (patch)
tree4f3d7914885a8ff4d1a2b6a7e775fd19a5d407ec /drivers
parentae91f08a8b52e4a4e5c474506016d6a5f1703b94 (diff)
UBUNTU: SAUCE: hid: ntrig: zero-initialize ntrig struct
Setting zeros using kzalloc instead. Has been tested succesfully on Dell Studio 17, Dell XT2, HP TX2 and Lenovo T410s. Not likely to go upstream in its present form. However, it does help constitue a tuning-free driver which works well together with Unity, and as such are vital to the MT push. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Acked-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-ntrig.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
index 3eafe29ce0c..29d42495472 100644
--- a/drivers/hid/hid-ntrig.c
+++ b/drivers/hid/hid-ntrig.c
@@ -870,23 +870,15 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
hdev->quirks |= HID_QUIRK_MULTI_INPUT
| HID_QUIRK_NO_INIT_REPORTS;
- nd = kmalloc(sizeof(struct ntrig_data), GFP_KERNEL);
+ nd = kzalloc(sizeof(struct ntrig_data), GFP_KERNEL);
if (!nd) {
hid_err(hdev, "cannot allocate N-Trig data\n");
return -ENOMEM;
}
- nd->reading_mt = 0;
- nd->min_width = 0;
- nd->min_height = 0;
nd->activate_slack = activate_slack;
nd->act_state = activate_slack;
nd->deactivate_slack = -deactivate_slack;
- nd->sensor_logical_width = 0;
- nd->sensor_logical_height = 0;
- nd->sensor_physical_width = 0;
- nd->sensor_physical_height = 0;
-
hid_set_drvdata(hdev, nd);
ret = hid_parse(hdev);