summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
index 0002bcc6c4ec..b3590b33cab9 100644
--- a/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
@@ -259,7 +259,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp)
return -EINVAL;
}
- isp->isp_cell = kcalloc(3, sizeof(struct mfd_cell), GFP_KERNEL);
+ isp->isp_cell = kzalloc_objs(struct mfd_cell, 3);
if (!isp->isp_cell) {
r = -ENOMEM;
drm_err(&adev->ddev, "isp mfd cell alloc failed (%d)\n", r);
@@ -268,15 +268,14 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp)
num_res = MAX_ISP411_MEM_RES + MAX_ISP411_INT_SRC;
- isp->isp_res = kcalloc(num_res, sizeof(struct resource),
- GFP_KERNEL);
+ isp->isp_res = kzalloc_objs(struct resource, num_res);
if (!isp->isp_res) {
r = -ENOMEM;
drm_err(&adev->ddev, "isp mfd resource alloc failed (%d)\n", r);
goto failure;
}
- isp->isp_pdata = kzalloc(sizeof(*isp->isp_pdata), GFP_KERNEL);
+ isp->isp_pdata = kzalloc_obj(*isp->isp_pdata);
if (!isp->isp_pdata) {
r = -ENOMEM;
drm_err(&adev->ddev, "isp platform data alloc failed (%d)\n", r);
@@ -318,7 +317,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp)
isp->isp_cell[0].pdata_size = sizeof(struct isp_platform_data);
/* initialize isp i2c platform data */
- isp->isp_i2c_res = kcalloc(1, sizeof(struct resource), GFP_KERNEL);
+ isp->isp_i2c_res = kzalloc_objs(struct resource, 1);
if (!isp->isp_i2c_res) {
r = -ENOMEM;
drm_err(&adev->ddev, "isp mfd res alloc failed (%d)\n", r);
@@ -337,7 +336,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp)
isp->isp_cell[1].pdata_size = sizeof(struct isp_platform_data);
/* initialize isp gpiochip platform data */
- isp->isp_gpio_res = kcalloc(1, sizeof(struct resource), GFP_KERNEL);
+ isp->isp_gpio_res = kzalloc_objs(struct resource, 1);
if (!isp->isp_gpio_res) {
r = -ENOMEM;
drm_err(&adev->ddev, "isp gpio resource alloc failed (%d)\n", r);