Skip to content

Commit

Permalink
HID: wacom: use devres to allocate driver data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Aug 5, 2016
1 parent c1f5409 commit 19b6433
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit 19b6433

Please sign in to comment.