Skip to content

Commit

Permalink
HID: ntrig: change default value of logical/physical width/height to 1
Browse files Browse the repository at this point in the history
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 <jesse.sung@canonical.com>
Acked-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Wen-chien Jesse Sung authored and Jiri Kosina committed Sep 25, 2012
1 parent ca9bbdc commit 4cc9834
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/hid/hid-ntrig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4cc9834

Please sign in to comment.