Skip to content

Commit

Permalink
HID: wacom: move unit and unitExpo initialization to wacom_calculate_res
Browse files Browse the repository at this point in the history
That is where they belong...

Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Ping Cheng authored and Jiri Kosina committed Apr 23, 2015
1 parent 42f4f27 commit 3d64f54
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,12 @@ static void wacom_set_default_phy(struct wacom_features *features)

static void wacom_calculate_res(struct wacom_features *features)
{
/* set unit to "100th of a mm" for devices not reported by HID */
if (!features->unit) {
features->unit = 0x11;
features->unitExpo = -3;
}

features->x_resolution = wacom_calc_hid_res(features->x_max,
features->x_phy,
features->unit,
Expand Down Expand Up @@ -1476,12 +1482,6 @@ static int wacom_probe(struct hid_device *hdev,
wacom_retrieve_hid_descriptor(hdev, features);

wacom_setup_device_quirks(wacom);

/* set unit to "100th of a mm" for devices not reported by HID */
if (!features->unit) {
features->unit = 0x11;
features->unitExpo = -3;
}
wacom_calculate_res(features);

strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
Expand Down

0 comments on commit 3d64f54

Please sign in to comment.