drm/msm/mdp5: use devres-managed allocation for INTF data
[linux-2.6-microblaze.git] / drivers / gpu / drm / msm / disp / mdp5 / mdp5_kms.c
index 4cfb1a8..48f447f 100644 (file)
@@ -616,11 +616,6 @@ fail:
 
 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)
                pm_runtime_disable(&mdp5_kms->pdev->dev);
 
@@ -741,7 +736,7 @@ static int interface_init(struct mdp5_kms *mdp5_kms)
                if (intf_types[i] == INTF_DISABLED)
                        continue;
 
-               intf = kzalloc(sizeof(*intf), GFP_KERNEL);
+               intf = devm_kzalloc(dev->dev, sizeof(*intf), GFP_KERNEL);
                if (!intf) {
                        DRM_DEV_ERROR(dev->dev, "failed to construct INTF%d\n", i);
                        return -ENOMEM;