Commit 6de8288b authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/mdp5: use devres-managed allocation for INTF data

Use devm_kzalloc to create INTF data structure. This allows us
to remove corresponding kfree() call.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/546163/
Link: https://lore.kernel.org/r/20230708010407.3871346-8-dmitry.baryshkov@linaro.org
parent 531d5313
...@@ -616,11 +616,6 @@ static int mdp5_kms_init(struct drm_device *dev) ...@@ -616,11 +616,6 @@ static int mdp5_kms_init(struct drm_device *dev)
static void mdp5_destroy(struct mdp5_kms *mdp5_kms) static void mdp5_destroy(struct mdp5_kms *mdp5_kms)
{ {
int i;
for (i = 0; i < mdp5_kms->num_intfs; i++)
kfree(mdp5_kms->intfs[i]);
if (mdp5_kms->rpm_enabled) if (mdp5_kms->rpm_enabled)
pm_runtime_disable(&mdp5_kms->pdev->dev); pm_runtime_disable(&mdp5_kms->pdev->dev);
...@@ -741,7 +736,7 @@ static int interface_init(struct mdp5_kms *mdp5_kms) ...@@ -741,7 +736,7 @@ static int interface_init(struct mdp5_kms *mdp5_kms)
if (intf_types[i] == INTF_DISABLED) if (intf_types[i] == INTF_DISABLED)
continue; continue;
intf = kzalloc(sizeof(*intf), GFP_KERNEL); intf = devm_kzalloc(dev->dev, sizeof(*intf), GFP_KERNEL);
if (!intf) { if (!intf) {
DRM_DEV_ERROR(dev->dev, "failed to construct INTF%d\n", i); DRM_DEV_ERROR(dev->dev, "failed to construct INTF%d\n", i);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment