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-23 08:46:58 -0600
commit8515223c287d901272566cbe534c9ca951daa8f9 (patch)
tree453d87e704f1751c224f5abd247bf48c9fd6142e /drivers
parent53072d368cb8bf5cc15ac90c792278bfecd7302c (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);