Skip to content

Commit

Permalink
HID: wacom - return ENODEV for failed wacom_setup_pad_input_capabilities
Browse files Browse the repository at this point in the history
ENODEV indicates no device is added. Hence, the associated pad input device
is simply freed.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by:  Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Ping Cheng authored and Jiri Kosina committed Nov 20, 2014
1 parent fefb391 commit b3c8e93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
case INTUOSPS:
/* touch interface does not have the pad device */
if (features->device_type != BTN_TOOL_PEN)
return 1;
return -ENODEV;

for (i = 0; i < 7; i++)
__set_bit(BTN_0 + i, input_dev->keybit);
Expand Down Expand Up @@ -2450,7 +2450,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
case BAMBOO_PT:
/* pad device is on the touch interface */
if (features->device_type != BTN_TOOL_FINGER)
return 1;
return -ENODEV;

__clear_bit(ABS_MISC, input_dev->absbit);

Expand All @@ -2463,7 +2463,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,

default:
/* no pad supported */
return 1;
return -ENODEV;
}
return 0;
}
Expand Down

0 comments on commit b3c8e93

Please sign in to comment.