From: Ping Cheng Date: Wed, 15 Apr 2015 23:54:14 +0000 (-0700) Subject: HID: wacom: move unit and unitExpo initialization to wacom_calculate_res X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3d64f54dd0de57bdbcde4b91495fb8e02c620762;p=deliverable%2Flinux.git HID: wacom: move unit and unitExpo initialization to wacom_calculate_res That is where they belong... Signed-off-by: Ping Cheng Reviewed-by: Jason Gerecke Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 13d8c8fa8ed4..b3c6f111093b 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -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, @@ -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));