summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/modules
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2017-09-27 10:53:50 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-28 16:46:15 -0400
commit2004f45ef83f07f43f5da6ede780b08068c7583d (patch)
tree011ac2087c8a8c9272a4c4c5eaacd69d44c2319a /drivers/gpu/drm/amd/display/modules
parent82b400a62f2fd42b87f91a298c5641d0ead99251 (diff)
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/modules')
-rw-r--r--drivers/gpu/drm/amd/display/modules/freesync/freesync.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 52350d0e68d0..4d7db4aa28e0 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -143,7 +143,7 @@ static bool check_dc_support(const struct dc *dc)
struct mod_freesync *mod_freesync_create(struct dc *dc)
{
struct core_freesync *core_freesync =
- dm_alloc(sizeof(struct core_freesync));
+ kzalloc(sizeof(struct core_freesync), GFP_KERNEL);
struct persistent_data_flag flag;
@@ -153,8 +153,8 @@ struct mod_freesync *mod_freesync_create(struct dc *dc)
if (core_freesync == NULL)
goto fail_alloc_context;
- core_freesync->map = dm_alloc(sizeof(struct freesync_entity) *
- MOD_FREESYNC_MAX_CONCURRENT_STREAMS);
+ core_freesync->map = kzalloc(sizeof(struct freesync_entity) * MOD_FREESYNC_MAX_CONCURRENT_STREAMS,
+ GFP_KERNEL);
if (core_freesync->map == NULL)
goto fail_alloc_map;
@@ -197,10 +197,10 @@ struct mod_freesync *mod_freesync_create(struct dc *dc)
return &core_freesync->public;
fail_construct:
- dm_free(core_freesync->map);
+ kfree(core_freesync->map);
fail_alloc_map:
- dm_free(core_freesync);
+ kfree(core_freesync);
fail_alloc_context:
return NULL;
@@ -217,9 +217,9 @@ void mod_freesync_destroy(struct mod_freesync *mod_freesync)
if (core_freesync->map[i].stream)
dc_stream_release(core_freesync->map[i].stream);
- dm_free(core_freesync->map);
+ kfree(core_freesync->map);
- dm_free(core_freesync);
+ kfree(core_freesync);
}
}