From: Wen-chien Jesse Sung Date: Tue, 25 Sep 2012 10:51:07 +0000 (+0800) Subject: HID: ntrig: change default value of logical/physical width/height to 1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4cc9834518efed3b69d3a8ff3bd162e089f68d34;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git HID: ntrig: change default value of logical/physical width/height to 1 Since something will be divided by these variables in show_min_width()/show_min_height() and show_activate_width()/ show_activate_height(), a divided error would be triggered if they are zero. Signed-off-by: Wen-chien Jesse Sung Acked-by: Rafi Rubin Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 9fae2ebdd758..86a969f63292 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -882,10 +882,10 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) 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; + nd->sensor_logical_width = 1; + nd->sensor_logical_height = 1; + nd->sensor_physical_width = 1; + nd->sensor_physical_height = 1; hid_set_drvdata(hdev, nd);