Commit 19b64330 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Jiri Kosina

HID: wacom: use devres to allocate driver data

We started switching the driver to devres, so we should use it as much
as possible.
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: default avatarPing Cheng <pingc@wacom.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent c1f5409b
...@@ -1844,7 +1844,7 @@ static int wacom_probe(struct hid_device *hdev, ...@@ -1844,7 +1844,7 @@ static int wacom_probe(struct hid_device *hdev,
/* hid-core sets this quirk for the boot interface */ /* hid-core sets this quirk for the boot interface */
hdev->quirks &= ~HID_QUIRK_NOGET; hdev->quirks &= ~HID_QUIRK_NOGET;
wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); wacom = devm_kzalloc(&hdev->dev, sizeof(struct wacom), GFP_KERNEL);
if (!wacom) if (!wacom)
return -ENOMEM; return -ENOMEM;
...@@ -1892,7 +1892,6 @@ static int wacom_probe(struct hid_device *hdev, ...@@ -1892,7 +1892,6 @@ static int wacom_probe(struct hid_device *hdev,
fail_type: fail_type:
fail_parse: fail_parse:
kfree(wacom);
hid_set_drvdata(hdev, NULL); hid_set_drvdata(hdev, NULL);
return error; return error;
} }
...@@ -1916,7 +1915,6 @@ static void wacom_remove(struct hid_device *hdev) ...@@ -1916,7 +1915,6 @@ static void wacom_remove(struct hid_device *hdev)
wacom_remove_shared_data(wacom); wacom_remove_shared_data(wacom);
hid_set_drvdata(hdev, NULL); hid_set_drvdata(hdev, NULL);
kfree(wacom);
} }
#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