imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,20 +1,20 @@
 int vc4_kms_load(struct drm_device *dev) {
   struct vc4_dev *vc4 = to_vc4_dev(dev);
   int ret;
   sema_init(&vc4->async_modeset, 1);
   ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
   if (ret < 0) {
     dev_err(dev->dev, "failed to initialize vblank\n");
     return ret;
   }
   dev->mode_config.max_width = 2048;
   dev->mode_config.max_height = 2048;
   dev->mode_config.funcs = &vc4_mode_funcs;
   dev->mode_config.preferred_depth = 24;
   dev->mode_config.async_page_flip = true;
   drm_mode_config_reset(dev);
-  vc4->fbdev = drm_fbdev_cma_init(dev, 32, dev->mode_config.num_crtc, dev->mode_config.num_connector);
+  vc4->fbdev = drm_fbdev_cma_init(dev, 32, dev->mode_config.num_connector);
   if (IS_ERR(vc4->fbdev)) vc4->fbdev = NULL;
   drm_kms_helper_poll_init(dev);
   return 0;
 }<sep>@@
expression A,B,C,D,E;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)
--- initial
+++ final
@@ -1,19 +1,19 @@
 int virtio_gpu_fbdev_init(struct virtio_gpu_device *vgdev) {
   struct virtio_gpu_fbdev *vgfbdev;
   int bpp_sel = 32; /* TODO: parameter from somewhere? */
   int ret;
   vgfbdev = kzalloc(sizeof(struct virtio_gpu_fbdev), GFP_KERNEL);
   if (!vgfbdev) return -ENOMEM;
   vgfbdev->vgdev = vgdev;
   vgdev->vgfbdev = vgfbdev;
   INIT_DELAYED_WORK(&vgfbdev->work, virtio_gpu_fb_dirty_work);
   drm_fb_helper_prepare(vgdev->ddev, &vgfbdev->helper, &virtio_gpu_fb_helper_funcs);
-  ret = drm_fb_helper_init(vgdev->ddev, &vgfbdev->helper, vgdev->num_scanouts, VIRTIO_GPUFB_CONN_LIMIT);
+  ret = drm_fb_helper_init(vgdev->ddev, &vgfbdev->helper, VIRTIO_GPUFB_CONN_LIMIT);
   if (ret) {
     kfree(vgfbdev);
     return ret;
   }
   drm_fb_helper_single_add_all_connectors(&vgfbdev->helper);
   drm_fb_helper_initial_config(&vgfbdev->helper, bpp_sel);
   return 0;
 }<sep>@@
expression A,B,C,D,E;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)
--- initial
+++ final
@@ -1,60 +1,60 @@
 static int zx_drm_bind(struct device *dev) {
   struct drm_device *drm;
   struct zx_drm_private *priv;
   int ret;
   priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
   if (!priv) return -ENOMEM;
   drm = drm_dev_alloc(&zx_drm_driver, dev);
   if (IS_ERR(drm)) return PTR_ERR(drm);
   drm->dev_private = priv;
   dev_set_drvdata(dev, drm);
   drm_mode_config_init(drm);
   drm->mode_config.min_width = 16;
   drm->mode_config.min_height = 16;
   drm->mode_config.max_width = 4096;
   drm->mode_config.max_height = 4096;
   drm->mode_config.funcs = &zx_drm_mode_config_funcs;
   ret = component_bind_all(dev, drm);
   if (ret) {
     DRM_DEV_ERROR(dev, "failed to bind all components: %d\n", ret);
     goto out_unregister;
   }
   ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
   if (ret < 0) {
     DRM_DEV_ERROR(dev, "failed to init vblank: %d\n", ret);
     goto out_unbind;
   }
   /*
    * We will manage irq handler on our own.  In this case, irq_enabled
    * need to be true for using vblank core support.
    */
   drm->irq_enabled = true;
   drm_mode_config_reset(drm);
   drm_kms_helper_poll_init(drm);
-  priv->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc, drm->mode_config.num_connector);
+  priv->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_connector);
   if (IS_ERR(priv->fbdev)) {
     ret = PTR_ERR(priv->fbdev);
     DRM_DEV_ERROR(dev, "failed to init cma fbdev: %d\n", ret);
     priv->fbdev = NULL;
     goto out_poll_fini;
   }
   ret = drm_dev_register(drm, 0);
   if (ret) goto out_fbdev_fini;
   return 0;
 out_fbdev_fini:
   if (priv->fbdev) {
     drm_fbdev_cma_fini(priv->fbdev);
     priv->fbdev = NULL;
   }
 out_poll_fini:
   drm_kms_helper_poll_fini(drm);
   drm_mode_config_cleanup(drm);
   drm_vblank_cleanup(drm);
 out_unbind:
   component_unbind_all(dev, drm);
 out_unregister:
   dev_set_drvdata(dev, NULL);
   drm->dev_private = NULL;
   drm_dev_unref(drm);
   return ret;
 }<sep>@@
expression A,B,C,D,E;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)
--- initial
+++ final
@@ -1,11 +1,11 @@
 int amdgpu_framebuffer_init(struct drm_device *dev, struct amdgpu_framebuffer *rfb, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj) {
   int ret;
   rfb->obj = obj;
-  drm_helper_mode_fill_fb_struct(&rfb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &rfb->base, mode_cmd);
   ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
   if (ret) {
     rfb->obj = NULL;
     return ret;
   }
   return 0;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,11 +1,11 @@
 int ast_framebuffer_init(struct drm_device *dev, struct ast_framebuffer *ast_fb, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj) {
   int ret;
-  drm_helper_mode_fill_fb_struct(&ast_fb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &ast_fb->base, mode_cmd);
   ast_fb->obj = obj;
   ret = drm_framebuffer_init(dev, &ast_fb->base, &ast_fb_funcs);
   if (ret) {
     DRM_ERROR("framebuffer init failed %d\n", ret);
     return ret;
   }
   return 0;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,11 +1,11 @@
 int bochs_framebuffer_init(struct drm_device *dev, struct bochs_framebuffer *gfb, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj) {
   int ret;
-  drm_helper_mode_fill_fb_struct(&gfb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &gfb->base, mode_cmd);
   gfb->obj = obj;
   ret = drm_framebuffer_init(dev, &gfb->base, &bochs_fb_funcs);
   if (ret) {
     DRM_ERROR("drm_framebuffer_init failed: %d\n", ret);
     return ret;
   }
   return 0;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,11 +1,11 @@
 int cirrus_framebuffer_init(struct drm_device *dev, struct cirrus_framebuffer *gfb, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj) {
   int ret;
-  drm_helper_mode_fill_fb_struct(&gfb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &gfb->base, mode_cmd);
   gfb->obj = obj;
   ret = drm_framebuffer_init(dev, &gfb->base, &cirrus_fb_funcs);
   if (ret) {
     DRM_ERROR("drm_framebuffer_init failed: %d\n", ret);
     return ret;
   }
   return 0;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,17 +1,17 @@
 static struct drm_fb_cma *drm_fb_cma_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_cma_object **obj, unsigned int num_planes, const struct drm_framebuffer_funcs *funcs) {
   struct drm_fb_cma *fb_cma;
   int ret;
   int i;
   fb_cma = kzalloc(sizeof(*fb_cma), GFP_KERNEL);
   if (!fb_cma) return ERR_PTR(-ENOMEM);
-  drm_helper_mode_fill_fb_struct(&fb_cma->fb, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &fb_cma->fb, mode_cmd);
   for (i = 0; i < num_planes; i++)
     fb_cma->obj[i] = obj[i];
   ret = drm_framebuffer_init(dev, &fb_cma->fb, funcs);
   if (ret) {
     dev_err(dev->dev, "Failed to initialize framebuffer: %d\n", ret);
     kfree(fb_cma);
     return ERR_PTR(ret);
   }
   return fb_cma;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,23 +1,23 @@
-void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, const struct drm_mode_fb_cmd2 *mode_cmd) {
+void drm_helper_mode_fill_fb_struct(struct drm_device *dev, struct drm_framebuffer *fb, const struct drm_mode_fb_cmd2 *mode_cmd) {
   const struct drm_format_info *info;
   int i;
   info = drm_format_info(mode_cmd->pixel_format);
   if (!info || !info->depth) {
     struct drm_format_name_buf format_name;
     DRM_DEBUG_KMS("non-RGB pixel format %s\n", drm_get_format_name(mode_cmd->pixel_format, &format_name));
     fb->depth = 0;
     fb->bits_per_pixel = 0;
   } else {
     fb->depth = info->depth;
     fb->bits_per_pixel = info->cpp[0] * 8;
   }
   fb->width = mode_cmd->width;
   fb->height = mode_cmd->height;
   for (i = 0; i < 4; i++) {
     fb->pitches[i] = mode_cmd->pitches[i];
     fb->offsets[i] = mode_cmd->offsets[i];
   }
   fb->modifier = mode_cmd->modifier[0];
   fb->pixel_format = mode_cmd->pixel_format;
   fb->flags = mode_cmd->flags;
 }<sep>@@
identifier fb, mode_cmd;
@@
 void drm_helper_mode_fill_fb_struct(
+                                    struct drm_device *dev,
                                     struct drm_framebuffer *fb,
                                     const struct drm_mode_fb_cmd2 *mode_cmd
                                     )
{ ... }
--- initial
+++ final
@@ -1,23 +1,23 @@
 struct drm_framebuffer *exynos_drm_framebuffer_init(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct exynos_drm_gem **exynos_gem, int count) {
   struct exynos_drm_fb *exynos_fb;
   int i;
   int ret;
   exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL);
   if (!exynos_fb) return ERR_PTR(-ENOMEM);
   for (i = 0; i < count; i++) {
     ret = check_fb_gem_memory_type(dev, exynos_gem[i]);
     if (ret < 0) goto err;
     exynos_fb->exynos_gem[i] = exynos_gem[i];
     exynos_fb->dma_addr[i] = exynos_gem[i]->dma_addr + mode_cmd->offsets[i];
   }
-  drm_helper_mode_fill_fb_struct(&exynos_fb->fb, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &exynos_fb->fb, mode_cmd);
   ret = drm_framebuffer_init(dev, &exynos_fb->fb, &exynos_drm_fb_funcs);
   if (ret < 0) {
     DRM_ERROR("failed to initialize framebuffer\n");
     goto err;
   }
   return &exynos_fb->fb;
 err:
   kfree(exynos_fb);
   return ERR_PTR(ret);
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,24 +1,24 @@
 static struct tegra_fb *tegra_fb_alloc(struct drm_device *drm, const struct drm_mode_fb_cmd2 *mode_cmd, struct tegra_bo **planes, unsigned int num_planes) {
   struct tegra_fb *fb;
   unsigned int i;
   int err;
   fb = kzalloc(sizeof(*fb), GFP_KERNEL);
   if (!fb) return ERR_PTR(-ENOMEM);
   fb->planes = kzalloc(num_planes * sizeof(*planes), GFP_KERNEL);
   if (!fb->planes) {
     kfree(fb);
     return ERR_PTR(-ENOMEM);
   }
   fb->num_planes = num_planes;
-  drm_helper_mode_fill_fb_struct(&fb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(drm, &fb->base, mode_cmd);
   for (i = 0; i < fb->num_planes; i++)
     fb->planes[i] = planes[i];
   err = drm_framebuffer_init(drm, &fb->base, &tegra_fb_funcs);
   if (err < 0) {
     dev_err(drm->dev, "failed to initialize framebuffer: %d\n", err);
     kfree(fb->planes);
     kfree(fb);
     return ERR_PTR(err);
   }
   return fb;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,19 +1,19 @@
 static int psb_framebuffer_init(struct drm_device *dev, struct psb_framebuffer *fb, const struct drm_mode_fb_cmd2 *mode_cmd, struct gtt_range *gt) {
   const struct drm_format_info *info;
   int ret;
   /*
    * Reject unknown formats, YUV formats, and formats with more than
    * 4 bytes per pixel.
    */
   info = drm_format_info(mode_cmd->pixel_format);
   if (!info || !info->depth || info->cpp[0] > 4) return -EINVAL;
   if (mode_cmd->pitches[0] & 63) return -EINVAL;
-  drm_helper_mode_fill_fb_struct(&fb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &fb->base, mode_cmd);
   fb->gtt = gt;
   ret = drm_framebuffer_init(dev, &fb->base, &psb_fb_funcs);
   if (ret) {
     dev_err(dev->dev, "framebuffer init failed: %d\n", ret);
     return ret;
   }
   return 0;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,18 +1,18 @@
 struct hibmc_framebuffer *hibmc_framebuffer_init(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj) {
   struct hibmc_framebuffer *hibmc_fb;
   int ret;
   hibmc_fb = kzalloc(sizeof(*hibmc_fb), GFP_KERNEL);
   if (!hibmc_fb) {
     DRM_ERROR("failed to allocate hibmc_fb\n");
     return ERR_PTR(-ENOMEM);
   }
-  drm_helper_mode_fill_fb_struct(&hibmc_fb->fb, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &hibmc_fb->fb, mode_cmd);
   hibmc_fb->obj = obj;
   ret = drm_framebuffer_init(dev, &hibmc_fb->fb, &hibmc_fb_funcs);
   if (ret) {
     DRM_ERROR("drm_framebuffer_init failed: %d\n", ret);
     kfree(hibmc_fb);
     return ERR_PTR(ret);
   }
   return hibmc_fb;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,12 +1,12 @@
 int mgag200_framebuffer_init(struct drm_device *dev, struct mga_framebuffer *gfb, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj) {
   int ret;
 
-  drm_helper_mode_fill_fb_struct(&gfb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &gfb->base, mode_cmd);
   gfb->obj = obj;
   ret = drm_framebuffer_init(dev, &gfb->base, &mga_fb_funcs);
   if (ret) {
     DRM_ERROR("drm_framebuffer_init failed: %d\n", ret);
     return ret;
   }
   return 0;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,52 +1,52 @@
 struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos) {
   struct msm_drm_private *priv = dev->dev_private;
   struct msm_kms *kms = priv->kms;
   struct msm_framebuffer *msm_fb = NULL;
   struct drm_framebuffer *fb;
   const struct msm_format *format;
   int ret, i, n;
   unsigned int hsub, vsub;
   DBG("create framebuffer: dev=%p, mode_cmd=%p (%dx%d@%4.4s)", dev, mode_cmd, mode_cmd->width, mode_cmd->height, (char *)&mode_cmd->pixel_format);
   n = drm_format_num_planes(mode_cmd->pixel_format);
   hsub = drm_format_horz_chroma_subsampling(mode_cmd->pixel_format);
   vsub = drm_format_vert_chroma_subsampling(mode_cmd->pixel_format);
   format = kms->funcs->get_format(kms, mode_cmd->pixel_format);
   if (!format) {
     dev_err(dev->dev, "unsupported pixel format: %4.4s\n", (char *)&mode_cmd->pixel_format);
     ret = -EINVAL;
     goto fail;
   }
   msm_fb = kzalloc(sizeof(*msm_fb), GFP_KERNEL);
   if (!msm_fb) {
     ret = -ENOMEM;
     goto fail;
   }
   fb = &msm_fb->base;
   msm_fb->format = format;
   if (n > ARRAY_SIZE(msm_fb->planes)) {
     ret = -EINVAL;
     goto fail;
   }
   for (i = 0; i < n; i++) {
     unsigned int width = mode_cmd->width / (i ? hsub : 1);
     unsigned int height = mode_cmd->height / (i ? vsub : 1);
     unsigned int min_size;
     min_size = (height - 1) * mode_cmd->pitches[i] + width * drm_format_plane_cpp(mode_cmd->pixel_format, i) + mode_cmd->offsets[i];
     if (bos[i]->size < min_size) {
       ret = -EINVAL;
       goto fail;
     }
     msm_fb->planes[i] = bos[i];
   }
-  drm_helper_mode_fill_fb_struct(fb, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd);
   ret = drm_framebuffer_init(dev, fb, &msm_framebuffer_funcs);
   if (ret) {
     dev_err(dev->dev, "framebuffer init failed: %d\n", ret);
     goto fail;
   }
   DBG("create: FB ID: %d (%p)", fb->base.id, fb);
   return fb;
 fail:
   kfree(msm_fb);
   return ERR_PTR(ret);
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,16 +1,16 @@
 static struct mtk_drm_fb *mtk_drm_framebuffer_init(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode, struct drm_gem_object *obj) {
   struct mtk_drm_fb *mtk_fb;
   int ret;
   if (drm_format_num_planes(mode->pixel_format) != 1) return ERR_PTR(-EINVAL);
   mtk_fb = kzalloc(sizeof(*mtk_fb), GFP_KERNEL);
   if (!mtk_fb) return ERR_PTR(-ENOMEM);
-  drm_helper_mode_fill_fb_struct(&mtk_fb->base, mode);
+  drm_helper_mode_fill_fb_struct(dev, &mtk_fb->base, mode);
   mtk_fb->gem_obj = obj;
   ret = drm_framebuffer_init(dev, &mtk_fb->base, &mtk_drm_fb_funcs);
   if (ret) {
     DRM_ERROR("failed to initialize framebuffer\n");
     kfree(mtk_fb);
     return ERR_PTR(ret);
   }
   return mtk_fb;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,10 +1,10 @@
 int nouveau_framebuffer_new(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct nouveau_bo *nvbo, struct nouveau_framebuffer **pfb) {
   struct nouveau_framebuffer *fb;
   int ret;
   if (!(fb = *pfb = kzalloc(sizeof(*fb), GFP_KERNEL))) return -ENOMEM;
-  drm_helper_mode_fill_fb_struct(&fb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &fb->base, mode_cmd);
   fb->nvbo = nvbo;
   ret = drm_framebuffer_init(dev, &fb->base, &nouveau_framebuffer_funcs);
   if (ret) kfree(fb);
   return ret;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,66 +1,66 @@
 struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos) {
   struct omap_framebuffer *omap_fb = NULL;
   struct drm_framebuffer *fb = NULL;
   const struct format *format = NULL;
   int ret, i, n = drm_format_num_planes(mode_cmd->pixel_format);
   DBG("create framebuffer: dev=%p, mode_cmd=%p (%dx%d@%4.4s)", dev, mode_cmd, mode_cmd->width, mode_cmd->height, (char *)&mode_cmd->pixel_format);
   for (i = 0; i < ARRAY_SIZE(formats); i++) {
     if (formats[i].pixel_format == mode_cmd->pixel_format) {
       format = &formats[i];
       break;
     }
   }
   if (!format) {
     dev_err(dev->dev, "unsupported pixel format: %4.4s\n", (char *)&mode_cmd->pixel_format);
     ret = -EINVAL;
     goto fail;
   }
   omap_fb = kzalloc(sizeof(*omap_fb), GFP_KERNEL);
   if (!omap_fb) {
     ret = -ENOMEM;
     goto fail;
   }
   fb = &omap_fb->base;
   omap_fb->format = format;
   mutex_init(&omap_fb->lock);
   for (i = 0; i < n; i++) {
     struct plane *plane = &omap_fb->planes[i];
     int size, pitch = mode_cmd->pitches[i];
     if (pitch < (mode_cmd->width * format->planes[i].stride_bpp)) {
       dev_err(dev->dev, "provided buffer pitch is too small! %d < %d\n", pitch, mode_cmd->width * format->planes[i].stride_bpp);
       ret = -EINVAL;
       goto fail;
     }
     if (pitch % format->planes[i].stride_bpp != 0) {
       dev_err(dev->dev, "buffer pitch (%d bytes) is not a multiple of pixel size (%d bytes)\n", pitch, format->planes[i].stride_bpp);
       ret = -EINVAL;
       goto fail;
     }
     size = pitch * mode_cmd->height / format->planes[i].sub_y;
     if (size > (omap_gem_mmap_size(bos[i]) - mode_cmd->offsets[i])) {
       dev_err(dev->dev, "provided buffer object is too small! %d < %d\n", bos[i]->size - mode_cmd->offsets[i], size);
       ret = -EINVAL;
       goto fail;
     }
     if (i > 0 && pitch != mode_cmd->pitches[i - 1]) {
       dev_err(dev->dev, "pitches are not the same between framebuffer planes %d != %d\n", pitch, mode_cmd->pitches[i - 1]);
       ret = -EINVAL;
       goto fail;
     }
     plane->bo = bos[i];
     plane->offset = mode_cmd->offsets[i];
     plane->pitch = pitch;
     plane->paddr = 0;
   }
-  drm_helper_mode_fill_fb_struct(fb, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd);
   ret = drm_framebuffer_init(dev, fb, &omap_framebuffer_funcs);
   if (ret) {
     dev_err(dev->dev, "framebuffer init failed: %d\n", ret);
     goto fail;
   }
   DBG("create: FB ID: %d (%p)", fb->base.id, fb);
   return fb;
 fail:
   kfree(omap_fb);
   return ERR_PTR(ret);
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,11 +1,11 @@
 int qxl_framebuffer_init(struct drm_device *dev, struct qxl_framebuffer *qfb, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj, const struct drm_framebuffer_funcs *funcs) {
   int ret;
   qfb->obj = obj;
   ret = drm_framebuffer_init(dev, &qfb->base, funcs);
   if (ret) {
     qfb->obj = NULL;
     return ret;
   }
-  drm_helper_mode_fill_fb_struct(&qfb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &qfb->base, mode_cmd);
   return 0;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,11 +1,11 @@
 int radeon_framebuffer_init(struct drm_device *dev, struct radeon_framebuffer *rfb, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj) {
   int ret;
   rfb->obj = obj;
-  drm_helper_mode_fill_fb_struct(&rfb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &rfb->base, mode_cmd);
   ret = drm_framebuffer_init(dev, &rfb->base, &radeon_fb_funcs);
   if (ret) {
     rfb->obj = NULL;
     return ret;
   }
   return 0;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}
--- initial
+++ final
@@ -1,17 +1,17 @@
 static struct rockchip_drm_fb *rockchip_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **obj, unsigned int num_planes) {
   struct rockchip_drm_fb *rockchip_fb;
   int ret;
   int i;
   rockchip_fb = kzalloc(sizeof(*rockchip_fb), GFP_KERNEL);
   if (!rockchip_fb) return ERR_PTR(-ENOMEM);
-  drm_helper_mode_fill_fb_struct(&rockchip_fb->fb, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &rockchip_fb->fb, mode_cmd);
   for (i = 0; i < num_planes; i++)
     rockchip_fb->obj[i] = obj[i];
   ret = drm_framebuffer_init(dev, &rockchip_fb->fb, &rockchip_drm_fb_funcs);
   if (ret) {
     dev_err(dev->dev, "Failed to initialize framebuffer: %d\n", ret);
     kfree(rockchip_fb);
     return ERR_PTR(ret);
   }
   return rockchip_fb;
 }<sep>@@
function func;
identifier dev;
expression E1, E2;
@@
func(struct drm_device *dev, ...)
{
 ...
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);
 ...
}