Commit 362c571b authored by Benjamin Tissoires's avatar Benjamin Tissoires

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: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
parent 670e9092
...@@ -2719,14 +2719,12 @@ static int wacom_probe(struct hid_device *hdev, ...@@ -2719,14 +2719,12 @@ static int wacom_probe(struct hid_device *hdev,
wacom_wac->features = *((struct wacom_features *)id->driver_data); wacom_wac->features = *((struct wacom_features *)id->driver_data);
features = &wacom_wac->features; features = &wacom_wac->features;
if (features->check_for_hid_type && features->hid_type != hdev->type) { if (features->check_for_hid_type && features->hid_type != hdev->type)
error = -ENODEV; return -ENODEV;
goto fail;
}
error = kfifo_alloc(&wacom_wac->pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL); error = kfifo_alloc(&wacom_wac->pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL);
if (error) if (error)
goto fail; return error;
wacom_wac->hid_data.inputmode = -1; wacom_wac->hid_data.inputmode = -1;
wacom_wac->mode_report = -1; wacom_wac->mode_report = -1;
...@@ -2744,12 +2742,12 @@ static int wacom_probe(struct hid_device *hdev, ...@@ -2744,12 +2742,12 @@ static int wacom_probe(struct hid_device *hdev,
error = hid_parse(hdev); error = hid_parse(hdev);
if (error) { if (error) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");
goto fail; return error;
} }
error = wacom_parse_and_register(wacom, false); error = wacom_parse_and_register(wacom, false);
if (error) if (error)
goto fail; return error;
if (hdev->bus == BUS_BLUETOOTH) { if (hdev->bus == BUS_BLUETOOTH) {
error = device_create_file(&hdev->dev, &dev_attr_speed); error = device_create_file(&hdev->dev, &dev_attr_speed);
...@@ -2760,10 +2758,6 @@ static int wacom_probe(struct hid_device *hdev, ...@@ -2760,10 +2758,6 @@ static int wacom_probe(struct hid_device *hdev,
} }
return 0; return 0;
fail:
hid_set_drvdata(hdev, NULL);
return error;
} }
static void wacom_remove(struct hid_device *hdev) static void wacom_remove(struct hid_device *hdev)
...@@ -2792,8 +2786,6 @@ static void wacom_remove(struct hid_device *hdev) ...@@ -2792,8 +2786,6 @@ static void wacom_remove(struct hid_device *hdev)
wacom_release_resources(wacom); wacom_release_resources(wacom);
kfifo_free(&wacom_wac->pen_fifo); kfifo_free(&wacom_wac->pen_fifo);
hid_set_drvdata(hdev, NULL);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment