Skip to content

Commit

Permalink
HID: wacom: do not call hid_set_drvdata(hdev, NULL)
Browse files Browse the repository at this point in the history
This is a common pattern in the HID drivers to reset the drvdata.
However, this is actually already handled by driver core, so there
is no need to do it manually.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
[jason.gerecke@wacom.com: Imported into input-wacom repository (362c571b92e2)]
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
  • Loading branch information
bentiss authored and jigpu committed Sep 3, 2019
1 parent ea97cd0 commit 5d053dc
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions 4.5/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -2778,14 +2778,12 @@ static int wacom_probe(struct hid_device *hdev,
wacom_wac->features = *((struct wacom_features *)id->driver_data);
features = &wacom_wac->features;

if (features->check_for_hid_type && features->hid_type != hdev->type) {
error = -ENODEV;
goto fail;
}
if (features->check_for_hid_type && features->hid_type != hdev->type)
return -ENODEV;

error = kfifo_alloc(&wacom_wac->pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL);
if (error)
goto fail;
return error;

wacom_wac->hid_data.inputmode = -1;
wacom_wac->mode_report = -1;
Expand All @@ -2803,12 +2801,12 @@ static int wacom_probe(struct hid_device *hdev,
error = hid_parse(hdev);
if (error) {
hid_err(hdev, "parse failed\n");
goto fail;
return error;
}

error = wacom_parse_and_register(wacom, false);
if (error)
goto fail;
return error;

if (hdev->bus == BUS_BLUETOOTH) {
error = device_create_file(&hdev->dev, &dev_attr_speed);
Expand All @@ -2819,10 +2817,6 @@ static int wacom_probe(struct hid_device *hdev,
}

return 0;

fail:
hid_set_drvdata(hdev, NULL);
return error;
}

static void wacom_remove(struct hid_device *hdev)
Expand Down Expand Up @@ -2851,8 +2845,6 @@ static void wacom_remove(struct hid_device *hdev)
wacom_release_resources(wacom);

kfifo_free(&wacom_wac->pen_fifo);

hid_set_drvdata(hdev, NULL);
}

#ifdef CONFIG_PM
Expand Down

0 comments on commit 5d053dc

Please sign in to comment.