aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-wacom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-wacom.c')
-rw-r--r--drivers/hid/hid-wacom.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 06888323828c..72ca689b6474 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -353,11 +353,7 @@ static int wacom_probe(struct hid_device *hdev,
353 if (ret) { 353 if (ret) {
354 hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n", 354 hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n",
355 ret); 355 ret);
356 /* 356 goto err_battery;
357 * battery attribute is not critical for the tablet, but if it
358 * failed then there is no need to create ac attribute
359 */
360 goto move_on;
361 } 357 }
362 358
363 wdata->ac.properties = wacom_ac_props; 359 wdata->ac.properties = wacom_ac_props;
@@ -371,18 +367,14 @@ static int wacom_probe(struct hid_device *hdev,
371 if (ret) { 367 if (ret) {
372 hid_warn(hdev, 368 hid_warn(hdev,
373 "can't create ac battery attribute, err: %d\n", ret); 369 "can't create ac battery attribute, err: %d\n", ret);
374 /* 370 goto err_ac;
375 * ac attribute is not critical for the tablet, but if it
376 * failed then we don't want to battery attribute to exist
377 */
378 power_supply_unregister(&wdata->battery);
379 } 371 }
380
381move_on:
382#endif 372#endif
383 hidinput = list_entry(hdev->inputs.next, struct hid_input, list); 373 hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
384 input = hidinput->input; 374 input = hidinput->input;
385 375
376 __set_bit(INPUT_PROP_POINTER, input->propbit);
377
386 /* Basics */ 378 /* Basics */
387 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL); 379 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL);
388 380
@@ -416,6 +408,13 @@ move_on:
416 408
417 return 0; 409 return 0;
418 410
411#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
412err_ac:
413 power_supply_unregister(&wdata->battery);
414err_battery:
415 device_remove_file(&hdev->dev, &dev_attr_speed);
416 hid_hw_stop(hdev);
417#endif
419err_free: 418err_free:
420 kfree(wdata); 419 kfree(wdata);
421 return ret; 420 return ret;
@@ -426,6 +425,7 @@ static void wacom_remove(struct hid_device *hdev)
426#ifdef CONFIG_HID_WACOM_POWER_SUPPLY 425#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
427 struct wacom_data *wdata = hid_get_drvdata(hdev); 426 struct wacom_data *wdata = hid_get_drvdata(hdev);
428#endif 427#endif
428 device_remove_file(&hdev->dev, &dev_attr_speed);
429 hid_hw_stop(hdev); 429 hid_hw_stop(hdev);
430 430
431#ifdef CONFIG_HID_WACOM_POWER_SUPPLY 431#ifdef CONFIG_HID_WACOM_POWER_SUPPLY