summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2016-07-13 18:05:58 +0200
committerJiri Kosina <jkosina@suse.cz>2016-08-05 13:39:15 +0200
commit19b643300181ccf2bd83cd751283508b9ae179f5 (patch)
tree410b2116bdcfec5407c9a7aab696a3e5934fd505 /drivers/hid
parentc1f5409b74c14ac021ef847e034356c904bc7882 (diff)
downloadlinux-19b643300181ccf2bd83cd751283508b9ae179f5.tar.gz
linux-19b643300181ccf2bd83cd751283508b9ae179f5.tar.bz2
linux-19b643300181ccf2bd83cd751283508b9ae179f5.zip
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: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/wacom_sys.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index ec088c1a4868..56d62e8a400b 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1844,7 +1844,7 @@ static int wacom_probe(struct hid_device *hdev,
/* hid-core sets this quirk for the boot interface */
hdev->quirks &= ~HID_QUIRK_NOGET;
- wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
+ wacom = devm_kzalloc(&hdev->dev, sizeof(struct wacom), GFP_KERNEL);
if (!wacom)
return -ENOMEM;
@@ -1892,7 +1892,6 @@ static int wacom_probe(struct hid_device *hdev,
fail_type:
fail_parse:
- kfree(wacom);
hid_set_drvdata(hdev, NULL);
return error;
}
@@ -1916,7 +1915,6 @@ static void wacom_remove(struct hid_device *hdev)
wacom_remove_shared_data(wacom);
hid_set_drvdata(hdev, NULL);
- kfree(wacom);
}
#ifdef CONFIG_PM