drm: flip-work: change drm_flip_work_init prototype
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Fri, 14 Nov 2014 18:30:30 +0000 (19:30 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 14 Nov 2014 23:29:14 +0000 (09:29 +1000)
Now that we're using lists instead of kfifo to store drm flip-work tasks
we do not need the size parameter passed to drm_flip_work_init function
anymore.
Moreover this function cannot fail anymore, we can thus remove the return
code.

Modify drm_flip_work_init users to take account of these changes.

[airlied: fixed two unused variable warnings]

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_flip_work.c
drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
drivers/gpu/drm/omapdrm/omap_plane.c
drivers/gpu/drm/tilcdc/tilcdc_crtc.c
include/drm/drm_flip_work.h

index 6f4ae5b655d3fd7b1bf1236dafe7da592aea86d0..43d9b950ef9fd03bb0f7eb267a0c46a01e6688c7 100644 (file)
@@ -136,16 +136,12 @@ static void flip_worker(struct work_struct *w)
 /**
  * drm_flip_work_init - initialize flip-work
  * @work: the flip-work to initialize
- * @size: the max queue depth
  * @name: debug name
  * @func: the callback work function
  *
  * Initializes/allocates resources for the flip-work
- *
- * RETURNS:
- * Zero on success, error code on failure.
  */
-int drm_flip_work_init(struct drm_flip_work *work, int size,
+void drm_flip_work_init(struct drm_flip_work *work,
                const char *name, drm_flip_func_t func)
 {
        work->name = name;
@@ -155,8 +151,6 @@ int drm_flip_work_init(struct drm_flip_work *work, int size,
        work->func = func;
 
        INIT_WORK(&work->worker, flip_worker);
-
-       return 0;
 }
 EXPORT_SYMBOL(drm_flip_work_init);
 
index 7d00f7fb5773571c2fd005df0e278c18de425b64..1ca87ae53d359ec18cf70bf9dda89a32757aa66b 100644 (file)
@@ -757,13 +757,10 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev,
 {
        struct drm_crtc *crtc = NULL;
        struct mdp4_crtc *mdp4_crtc;
-       int ret;
 
        mdp4_crtc = kzalloc(sizeof(*mdp4_crtc), GFP_KERNEL);
-       if (!mdp4_crtc) {
-               ret = -ENOMEM;
-               goto fail;
-       }
+       if (!mdp4_crtc)
+               return ERR_PTR(-ENOMEM);
 
        crtc = &mdp4_crtc->base;
 
@@ -784,12 +781,9 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev,
 
        spin_lock_init(&mdp4_crtc->cursor.lock);
 
-       ret = drm_flip_work_init(&mdp4_crtc->unref_fb_work, 16,
+       drm_flip_work_init(&mdp4_crtc->unref_fb_work,
                        "unref fb", unref_fb_worker);
-       if (ret)
-               goto fail;
-
-       ret = drm_flip_work_init(&mdp4_crtc->unref_cursor_work, 64,
+       drm_flip_work_init(&mdp4_crtc->unref_cursor_work,
                        "unref cursor", unref_cursor_worker);
 
        INIT_FENCE_CB(&mdp4_crtc->pageflip_cb, pageflip_cb);
@@ -800,10 +794,4 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev,
        mdp4_plane_install_properties(mdp4_crtc->plane, &crtc->base);
 
        return crtc;
-
-fail:
-       if (crtc)
-               mdp4_crtc_destroy(crtc);
-
-       return ERR_PTR(ret);
 }
index ebe2e60f3ab1147826e49a79b9772f4115635040..2979a2cc82a4a6a6ae377e17328e76692638f5bc 100644 (file)
@@ -534,13 +534,10 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev,
 {
        struct drm_crtc *crtc = NULL;
        struct mdp5_crtc *mdp5_crtc;
-       int ret;
 
        mdp5_crtc = kzalloc(sizeof(*mdp5_crtc), GFP_KERNEL);
-       if (!mdp5_crtc) {
-               ret = -ENOMEM;
-               goto fail;
-       }
+       if (!mdp5_crtc)
+               return ERR_PTR(-ENOMEM);
 
        crtc = &mdp5_crtc->base;
 
@@ -553,10 +550,8 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev,
        snprintf(mdp5_crtc->name, sizeof(mdp5_crtc->name), "%s:%d",
                        pipe2name(mdp5_plane_pipe(plane)), id);
 
-       ret = drm_flip_work_init(&mdp5_crtc->unref_fb_work, 16,
+       drm_flip_work_init(&mdp5_crtc->unref_fb_work,
                        "unref fb", unref_fb_worker);
-       if (ret)
-               goto fail;
 
        INIT_FENCE_CB(&mdp5_crtc->pageflip_cb, pageflip_cb);
 
@@ -566,10 +561,4 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev,
        mdp5_plane_install_properties(mdp5_crtc->plane, &crtc->base);
 
        return crtc;
-
-fail:
-       if (crtc)
-               mdp5_crtc_destroy(crtc);
-
-       return ERR_PTR(ret);
 }
index 891a4dc608af85f2760ced973c9cf5163743d08f..0ad740132ac376c94ae8b063b4caf1243e8287c6 100644 (file)
@@ -394,14 +394,10 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
 
        omap_plane = kzalloc(sizeof(*omap_plane), GFP_KERNEL);
        if (!omap_plane)
-               goto fail;
+               return NULL;
 
-       ret = drm_flip_work_init(&omap_plane->unpin_work, 16,
+       drm_flip_work_init(&omap_plane->unpin_work,
                        "unpin", unpin_worker);
-       if (ret) {
-               dev_err(dev->dev, "could not allocate unpin FIFO\n");
-               goto fail;
-       }
 
        omap_plane->nformats = omap_framebuffer_get_formats(
                        omap_plane->formats, ARRAY_SIZE(omap_plane->formats),
@@ -443,10 +439,4 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
                omap_plane->info.zorder = id;
 
        return plane;
-
-fail:
-       if (plane)
-               omap_plane_destroy(plane);
-
-       return NULL;
 }
index 29ec98baffd19faf55df10896bbca4953db4de17..c73588483be02e0ba97e52017ff972e59841c4d7 100644 (file)
@@ -665,12 +665,8 @@ struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev)
        tilcdc_crtc->dpms = DRM_MODE_DPMS_OFF;
        init_waitqueue_head(&tilcdc_crtc->frame_done_wq);
 
-       ret = drm_flip_work_init(&tilcdc_crtc->unref_work, 16,
+       drm_flip_work_init(&tilcdc_crtc->unref_work,
                        "unref", unref_worker);
-       if (ret) {
-               dev_err(dev->dev, "could not allocate unref FIFO\n");
-               goto fail;
-       }
 
        ret = drm_crtc_init(dev, crtc, &tilcdc_crtc_funcs);
        if (ret < 0)
index 3fcb4c44c9e0cf46d10ce0d38edd7a8f40d797b9..d387cf06ae05676667cd91afc37f61d57ae6c749 100644 (file)
@@ -85,7 +85,7 @@ void drm_flip_work_queue_task(struct drm_flip_work *work,
 void drm_flip_work_queue(struct drm_flip_work *work, void *val);
 void drm_flip_work_commit(struct drm_flip_work *work,
                struct workqueue_struct *wq);
-int drm_flip_work_init(struct drm_flip_work *work, int size,
+void drm_flip_work_init(struct drm_flip_work *work,
                const char *name, drm_flip_func_t func);
 void drm_flip_work_cleanup(struct drm_flip_work *work);