summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
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/dc/bios/bios_parser2.c
parent82b400a62f2fd42b87f91a298c5641d0ead99251 (diff)
downloadlinux-2004f45ef83f07f43f5da6ede780b08068c7583d.tar.bz2
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/bios/bios_parser2.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
index 95fe50f62c57..3f8e605efde9 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
@@ -107,10 +107,10 @@ static struct atom_encoder_caps_record *get_encoder_cap_record(
static void destruct(struct bios_parser *bp)
{
if (bp->base.bios_local_image)
- dm_free(bp->base.bios_local_image);
+ kfree(bp->base.bios_local_image);
if (bp->base.integrated_info)
- dm_free(bp->base.integrated_info);
+ kfree(bp->base.integrated_info);
}
static void firmware_parser_destroy(struct dc_bios **dcb)
@@ -124,7 +124,7 @@ static void firmware_parser_destroy(struct dc_bios **dcb)
destruct(bp);
- dm_free(bp);
+ kfree(bp);
*dcb = NULL;
}
@@ -2030,7 +2030,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
struct bios_parser *bp = BP_FROM_DCB(dcb);
struct integrated_info *info = NULL;
- info = dm_alloc(sizeof(struct integrated_info));
+ info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
if (info == NULL) {
ASSERT_CRITICAL(0);
@@ -2040,7 +2040,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
if (construct_integrated_info(bp, info) == BP_RESULT_OK)
return info;
- dm_free(info);
+ kfree(info);
return NULL;
}
@@ -2205,14 +2205,14 @@ struct dc_bios *firmware_parser_create(
{
struct bios_parser *bp = NULL;
- bp = dm_alloc(sizeof(struct bios_parser));
+ bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL);
if (!bp)
return NULL;
if (bios_parser_construct(bp, init, dce_version))
return &bp->base;
- dm_free(bp);
+ kfree(bp);
return NULL;
}