diff options
author | Harry Wentland <harry.wentland@amd.com> | 2017-09-27 10:53:50 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-28 16:46:15 -0400 |
commit | 2004f45ef83f07f43f5da6ede780b08068c7583d (patch) | |
tree | 011ac2087c8a8c9272a4c4c5eaacd69d44c2319a /drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | |
parent | 82b400a62f2fd42b87f91a298c5641d0ead99251 (diff) | |
download | linux-2004f45ef83f07f43f5da6ede780b08068c7583d.tar.gz linux-2004f45ef83f07f43f5da6ede780b08068c7583d.tar.bz2 linux-2004f45ef83f07f43f5da6ede780b08068c7583d.zip |
drm/amd/display: Use kernel alloc/free
Abstractions are frowned upon.
cocci script:
virtual context
virtual patch
virtual org
virtual report
@@
expression ptr;
@@
- dm_alloc(ptr)
+ kzalloc(ptr, GFP_KERNEL)
@@
expression ptr, size;
@@
- dm_realloc(ptr, size)
+ krealloc(ptr, size, GFP_KERNEL)
@@
expression ptr;
@@
- dm_free(ptr)
+ kfree(ptr)
v2: use GFP_KERNEL, not GFP_ATOMIC. add cocci script
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c index 9634e8841d90..0c255c02045b 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c @@ -72,7 +72,7 @@ static void destroy( destruct(hpd); - dm_free(hpd); + kfree(hpd); *ptr = NULL; } @@ -157,7 +157,7 @@ struct hw_gpio_pin *dal_hw_hpd_create( enum gpio_id id, uint32_t en) { - struct hw_hpd *hpd = dm_alloc(sizeof(struct hw_hpd)); + struct hw_hpd *hpd = kzalloc(sizeof(struct hw_hpd), GFP_KERNEL); if (!hpd) { ASSERT_CRITICAL(false); @@ -169,7 +169,7 @@ struct hw_gpio_pin *dal_hw_hpd_create( ASSERT_CRITICAL(false); - dm_free(hpd); + kfree(hpd); return NULL; } |