aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/wacom_wac.c
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2014-11-06 20:30:51 -0500
committerJiri Kosina <jkosina@suse.cz>2014-11-07 10:40:47 -0500
commit44b9683853c7b47d039366d7d2fd0d5380aba276 (patch)
tree66d9f66a99f426672f16431d1846aff4a38eb2cd /drivers/hid/wacom_wac.c
parent7f474df0a7b7dadfc01ba778460a91f554ca1481 (diff)
HID: wacom - make sure touch_input is valid before using it
touch_input is stored in wacom_shared for pen data to report touch switch status. It is possible, although we didn't see it happen on Linux yet, that pen data is procesed before touch interface is fully probed. As a by-product of this patch, it fixes the FreeBSD issue reported by Denis Akiyakov http://www.spinics.net/lists/linux-input/msg33971.html Reviewed-by: Hans Petter Selasky <hps@selasky.org> Tested-by: Denis Akiyakov <d.akiyakov@gmail.com> Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_wac.c')
-rw-r--r--drivers/hid/wacom_wac.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 586b2405b0d4..d343a6ee5bf7 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1681,7 +1681,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
1681 return 0; 1681 return 0;
1682 1682
1683 if (data[0] == WACOM_REPORT_USB) { 1683 if (data[0] == WACOM_REPORT_USB) {
1684 if (features->type == INTUOSHT && features->touch_max) { 1684 if (features->type == INTUOSHT &&
1685 wacom->shared->touch_input &&
1686 features->touch_max) {
1685 input_report_switch(wacom->shared->touch_input, 1687 input_report_switch(wacom->shared->touch_input,
1686 SW_MUTE_DEVICE, data[8] & 0x40); 1688 SW_MUTE_DEVICE, data[8] & 0x40);
1687 input_sync(wacom->shared->touch_input); 1689 input_sync(wacom->shared->touch_input);
@@ -1774,7 +1776,8 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
1774 int pid, battery, ps_connected; 1776 int pid, battery, ps_connected;
1775 1777
1776 if ((wacom->shared->type == INTUOSHT) && 1778 if ((wacom->shared->type == INTUOSHT) &&
1777 wacom->shared->touch_max) { 1779 wacom->shared->touch_input &&
1780 wacom->shared->touch_max) {
1778 input_report_switch(wacom->shared->touch_input, 1781 input_report_switch(wacom->shared->touch_input,
1779 SW_MUTE_DEVICE, data[5] & 0x40); 1782 SW_MUTE_DEVICE, data[5] & 0x40);
1780 input_sync(wacom->shared->touch_input); 1783 input_sync(wacom->shared->touch_input);