lkml.org 
[lkml]   [2016]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 11/30] HID: wacom: use devres to allocate driver data
Date
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>
---

No changes in v2
---
drivers/hid/wacom_sys.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index ec088c1..56d62e8 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
--
2.5.5
\
 
 \ /
  Last update: 2016-07-13 19:01    [W:0.167 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site