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-09-12 09:02:46 -0600
commit753824293dee7923babd196f4454c6bec5adf7c2 (patch)
tree453d87e704f1751c224f5abd247bf48c9fd6142e /drivers
parentc386c28fd1b53f92d26cbb87723aac52e5ce0c93 (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);