Skip to content

Commit 362c571

Browse files
committed
HID: wacom: do not call hid_set_drvdata(hdev, NULL)
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 <[email protected]> Acked-by: Jason Gerecke <[email protected]>
1 parent 670e909 commit 362c571

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

drivers/hid/wacom_sys.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,14 +2719,12 @@ static int wacom_probe(struct hid_device *hdev,
27192719
wacom_wac->features = *((struct wacom_features *)id->driver_data);
27202720
features = &wacom_wac->features;
27212721

2722-
if (features->check_for_hid_type && features->hid_type != hdev->type) {
2723-
error = -ENODEV;
2724-
goto fail;
2725-
}
2722+
if (features->check_for_hid_type && features->hid_type != hdev->type)
2723+
return -ENODEV;
27262724

27272725
error = kfifo_alloc(&wacom_wac->pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL);
27282726
if (error)
2729-
goto fail;
2727+
return error;
27302728

27312729
wacom_wac->hid_data.inputmode = -1;
27322730
wacom_wac->mode_report = -1;
@@ -2744,12 +2742,12 @@ static int wacom_probe(struct hid_device *hdev,
27442742
error = hid_parse(hdev);
27452743
if (error) {
27462744
hid_err(hdev, "parse failed\n");
2747-
goto fail;
2745+
return error;
27482746
}
27492747

27502748
error = wacom_parse_and_register(wacom, false);
27512749
if (error)
2752-
goto fail;
2750+
return error;
27532751

27542752
if (hdev->bus == BUS_BLUETOOTH) {
27552753
error = device_create_file(&hdev->dev, &dev_attr_speed);
@@ -2760,10 +2758,6 @@ static int wacom_probe(struct hid_device *hdev,
27602758
}
27612759

27622760
return 0;
2763-
2764-
fail:
2765-
hid_set_drvdata(hdev, NULL);
2766-
return error;
27672761
}
27682762

27692763
static void wacom_remove(struct hid_device *hdev)
@@ -2792,8 +2786,6 @@ static void wacom_remove(struct hid_device *hdev)
27922786
wacom_release_resources(wacom);
27932787

27942788
kfifo_free(&wacom_wac->pen_fifo);
2795-
2796-
hid_set_drvdata(hdev, NULL);
27972789
}
27982790

27992791
#ifdef CONFIG_PM

0 commit comments

Comments
 (0)