summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.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/gpio/gpio_service.c
parent82b400a62f2fd42b87f91a298c5641d0ead99251 (diff)
downloadlinux-stable-2004f45ef83f07f43f5da6ede780b08068c7583d.tar.gz
linux-stable-2004f45ef83f07f43f5da6ede780b08068c7583d.tar.bz2
linux-stable-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/gpio_service.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
index eeb1cd0f75a6..d4e5ef64e489 100644
--- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
+++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
@@ -59,7 +59,7 @@ struct gpio_service *dal_gpio_service_create(
uint32_t index_of_id;
- service = dm_alloc(sizeof(struct gpio_service));
+ service = kzalloc(sizeof(struct gpio_service), GFP_KERNEL);
if (!service) {
BREAK_TO_DEBUGGER();
@@ -98,7 +98,8 @@ struct gpio_service *dal_gpio_service_create(
if (number_of_bits) {
uint32_t index_of_uint = 0;
- slot = dm_alloc(number_of_uints * sizeof(uint32_t));
+ slot = kzalloc(number_of_uints * sizeof(uint32_t),
+ GFP_KERNEL);
if (!slot) {
BREAK_TO_DEBUGGER();
@@ -130,11 +131,11 @@ failure_2:
slot = service->busyness[index_of_id];
if (slot)
- dm_free(slot);
+ kfree(slot);
};
failure_1:
- dm_free(service);
+ kfree(service);
return NULL;
}
@@ -171,13 +172,13 @@ void dal_gpio_service_destroy(
uint32_t *slot = (*ptr)->busyness[index_of_id];
if (slot)
- dm_free(slot);
+ kfree(slot);
++index_of_id;
} while (index_of_id < GPIO_ID_COUNT);
}
- dm_free(*ptr);
+ kfree(*ptr);
*ptr = NULL;
}
@@ -399,7 +400,7 @@ void dal_gpio_destroy_irq(
dal_gpio_close(*irq);
dal_gpio_destroy(irq);
- dm_free(*irq);
+ kfree(*irq);
*irq = NULL;
}
@@ -417,7 +418,7 @@ struct ddc *dal_gpio_create_ddc(
if (!service->translate.funcs->offset_to_id(offset, mask, &id, &en))
return NULL;
- ddc = dm_alloc(sizeof(struct ddc));
+ ddc = kzalloc(sizeof(struct ddc), GFP_KERNEL);
if (!ddc) {
BREAK_TO_DEBUGGER();
@@ -450,7 +451,7 @@ failure_2:
dal_gpio_destroy(&ddc->pin_data);
failure_1:
- dm_free(ddc);
+ kfree(ddc);
return NULL;
}
@@ -466,7 +467,7 @@ void dal_gpio_destroy_ddc(
dal_ddc_close(*ddc);
dal_gpio_destroy(&(*ddc)->pin_data);
dal_gpio_destroy(&(*ddc)->pin_clock);
- dm_free(*ddc);
+ kfree(*ddc);
*ddc = NULL;
}