drm/msm/mdp5: use devres-managed allocation for pipe data
[linux-2.6-microblaze.git] / drivers / gpu / drm / msm / disp / mdp5 / mdp5_pipe.c
index e4b8a78..99b2c30 100644 (file)
@@ -151,17 +151,13 @@ int mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe)
        return 0;
 }
 
-void mdp5_pipe_destroy(struct mdp5_hw_pipe *hwpipe)
-{
-       kfree(hwpipe);
-}
-
-struct mdp5_hw_pipe *mdp5_pipe_init(enum mdp5_pipe pipe,
+struct mdp5_hw_pipe *mdp5_pipe_init(struct drm_device *dev,
+               enum mdp5_pipe pipe,
                uint32_t reg_offset, uint32_t caps)
 {
        struct mdp5_hw_pipe *hwpipe;
 
-       hwpipe = kzalloc(sizeof(*hwpipe), GFP_KERNEL);
+       hwpipe = devm_kzalloc(dev->dev, sizeof(*hwpipe), GFP_KERNEL);
        if (!hwpipe)
                return ERR_PTR(-ENOMEM);