imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,78 +1,78 @@
 static int imx_drm_bind(struct device *dev) {
   struct drm_device *drm;
   struct imx_drm_device *imxdrm;
   int ret;
   drm = drm_dev_alloc(&imx_drm_driver, dev);
   if (IS_ERR(drm)) return PTR_ERR(drm);
   imxdrm = devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL);
   if (!imxdrm) {
     ret = -ENOMEM;
     goto err_unref;
   }
   imxdrm->drm = drm;
   drm->dev_private = imxdrm;
   /*
    * enable drm irq mode.
    * - with irq_enabled = true, we can use the vblank feature.
    *
    * P.S. note that we wouldn't use drm irq handler but
    *      just specific driver own one instead because
    *      drm framework supports only one irq handler and
    *      drivers can well take care of their interrupts
    */
   drm->irq_enabled = true;
   /*
    * set max width and height as default value(4096x4096).
    * this value would be used to check framebuffer size limitation
    * at drm_mode_addfb().
    */
   drm->mode_config.min_width = 64;
   drm->mode_config.min_height = 64;
   drm->mode_config.max_width = 4096;
   drm->mode_config.max_height = 4096;
   drm->mode_config.funcs = &imx_drm_mode_config_funcs;
   drm->mode_config.helper_private = &imx_drm_mode_config_helpers;
   drm_mode_config_init(drm);
   ret = drm_vblank_init(drm, MAX_CRTC);
   if (ret) goto err_kms;
   dev_set_drvdata(dev, drm);
   /* Now try and bind all our sub-components */
   ret = component_bind_all(dev, drm);
   if (ret) goto err_vblank;
   drm_mode_config_reset(drm);
   /*
    * All components are now initialised, so setup the fb helper.
    * The fb helper takes copies of key hardware information, so the
    * crtcs/connectors/encoders must not change after this point.
    */
 #if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
   if (legacyfb_depth != 16 && legacyfb_depth != 32) {
     dev_warn(dev, "Invalid legacyfb_depth.  Defaulting to 16bpp\n");
     legacyfb_depth = 16;
   }
-  imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth, drm->mode_config.num_crtc, MAX_CRTC);
+  imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth, MAX_CRTC);
   if (IS_ERR(imxdrm->fbhelper)) {
     ret = PTR_ERR(imxdrm->fbhelper);
     imxdrm->fbhelper = NULL;
     goto err_unbind;
   }
 #endif
   drm_kms_helper_poll_init(drm);
   ret = drm_dev_register(drm, 0);
   if (ret) goto err_fbhelper;
   return 0;
 err_fbhelper:
   drm_kms_helper_poll_fini(drm);
 #if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
   if (imxdrm->fbhelper) drm_fbdev_cma_fini(imxdrm->fbhelper);
 err_unbind:
 #endif
   component_unbind_all(drm->dev, drm);
 err_vblank:
   drm_vblank_cleanup(drm);
 err_kms:
   drm_mode_config_cleanup(drm);
 err_unref:
   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,19 +1,19 @@
 int intel_fbdev_init(struct drm_device *dev) {
   struct drm_i915_private *dev_priv = to_i915(dev);
   struct intel_fbdev *ifbdev;
   int ret;
   if (WARN_ON(INTEL_INFO(dev_priv)->num_pipes == 0)) return -ENODEV;
   ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
   if (ifbdev == NULL) return -ENOMEM;
   drm_fb_helper_prepare(dev, &ifbdev->helper, &intel_fb_helper_funcs);
   if (!intel_fbdev_init_bios(dev, ifbdev)) ifbdev->preferred_bpp = 32;
-  ret = drm_fb_helper_init(dev, &ifbdev->helper, INTEL_INFO(dev_priv)->num_pipes, 4);
+  ret = drm_fb_helper_init(dev, &ifbdev->helper, 4);
   if (ret) {
     kfree(ifbdev);
     return ret;
   }
   dev_priv->fbdev = ifbdev;
   INIT_WORK(&dev_priv->fbdev_suspend_work, intel_fbdev_suspend_worker);
   drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
   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,9 +1,9 @@
 static void kirin_fbdev_output_poll_changed(struct drm_device *dev) {
   struct kirin_drm_private *priv = dev->dev_private;
   if (priv->fbdev) {
     drm_fbdev_cma_hotplug_event(priv->fbdev);
   } else {
-    priv->fbdev = drm_fbdev_cma_init(dev, 32, dev->mode_config.num_crtc, dev->mode_config.num_connector);
+    priv->fbdev = drm_fbdev_cma_init(dev, 32, dev->mode_config.num_connector);
     if (IS_ERR(priv->fbdev)) priv->fbdev = NULL;
   }
 }<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,78 +1,78 @@
 static int meson_drv_probe(struct platform_device *pdev) {
   struct device *dev = &pdev->dev;
   struct meson_drm *priv;
   struct drm_device *drm;
   struct resource *res;
   void __iomem *regs;
   int ret;
   /* Checks if an output connector is available */
   if (!meson_vpu_has_available_connectors(dev)) {
     dev_err(dev, "No output connector available\n");
     return -ENODEV;
   }
   drm = drm_dev_alloc(&meson_driver, dev);
   if (IS_ERR(drm)) return PTR_ERR(drm);
   priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
   if (!priv) {
     ret = -ENOMEM;
     goto free_drm;
   }
   drm->dev_private = priv;
   priv->drm = drm;
   priv->dev = dev;
   res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vpu");
   regs = devm_ioremap_resource(dev, res);
   if (IS_ERR(regs)) return PTR_ERR(regs);
   priv->io_base = regs;
   res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi");
   /* Simply ioremap since it may be a shared register zone */
   regs = devm_ioremap(dev, res->start, resource_size(res));
   if (!regs) return -EADDRNOTAVAIL;
   priv->hhi = devm_regmap_init_mmio(dev, regs, &meson_regmap_config);
   if (IS_ERR(priv->hhi)) {
     dev_err(&pdev->dev, "Couldn't create the HHI regmap\n");
     return PTR_ERR(priv->hhi);
   }
   res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc");
   /* Simply ioremap since it may be a shared register zone */
   regs = devm_ioremap(dev, res->start, resource_size(res));
   if (!regs) return -EADDRNOTAVAIL;
   priv->dmc = devm_regmap_init_mmio(dev, regs, &meson_regmap_config);
   if (IS_ERR(priv->dmc)) {
     dev_err(&pdev->dev, "Couldn't create the DMC regmap\n");
     return PTR_ERR(priv->dmc);
   }
   priv->vsync_irq = platform_get_irq(pdev, 0);
   drm_vblank_init(drm, 1);
   drm_mode_config_init(drm);
   /* Encoder Initialization */
   ret = meson_venc_cvbs_create(priv);
   if (ret) goto free_drm;
   /* Hardware Initialization */
   meson_venc_init(priv);
   meson_vpp_init(priv);
   meson_viu_init(priv);
   ret = meson_plane_create(priv);
   if (ret) goto free_drm;
   ret = meson_crtc_create(priv);
   if (ret) goto free_drm;
   ret = drm_irq_install(drm, priv->vsync_irq);
   if (ret) goto free_drm;
   drm_mode_config_reset(drm);
   drm->mode_config.max_width = 8192;
   drm->mode_config.max_height = 8192;
   drm->mode_config.funcs = &meson_mode_config_funcs;
-  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);
     goto free_drm;
   }
   drm_kms_helper_poll_init(drm);
   platform_set_drvdata(pdev, priv);
   ret = drm_dev_register(drm, 0);
   if (ret) goto free_drm;
   return 0;
 free_drm:
   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,26 +1,26 @@
 int mgag200_fbdev_init(struct mga_device *mdev) {
   struct mga_fbdev *mfbdev;
   int ret;
   int bpp_sel = 32;
   /* prefer 16bpp on low end gpus with limited VRAM */
   if (IS_G200_SE(mdev) && mdev->mc.vram_size < (2048 * 1024)) bpp_sel = 16;
   mfbdev = devm_kzalloc(mdev->dev->dev, sizeof(struct mga_fbdev), GFP_KERNEL);
   if (!mfbdev) return -ENOMEM;
   mdev->mfbdev = mfbdev;
   spin_lock_init(&mfbdev->dirty_lock);
   drm_fb_helper_prepare(mdev->dev, &mfbdev->helper, &mga_fb_helper_funcs);
-  ret = drm_fb_helper_init(mdev->dev, &mfbdev->helper, mdev->num_crtc, MGAG200FB_CONN_LIMIT);
+  ret = drm_fb_helper_init(mdev->dev, &mfbdev->helper, MGAG200FB_CONN_LIMIT);
   if (ret) goto err_fb_helper;
   ret = drm_fb_helper_single_add_all_connectors(&mfbdev->helper);
   if (ret) goto err_fb_setup;
   /* disable all the possible outputs/crtcs before entering KMS mode */
   drm_helper_disable_unused_functions(mdev->dev);
   ret = drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel);
   if (ret) goto err_fb_setup;
   return 0;
 err_fb_setup:
   drm_fb_helper_fini(&mfbdev->helper);
 err_fb_helper:
   mdev->mfbdev = NULL;
   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,26 +1,26 @@
 struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev) {
   struct msm_drm_private *priv = dev->dev_private;
   struct msm_fbdev *fbdev = NULL;
   struct drm_fb_helper *helper;
   int ret;
   fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
   if (!fbdev) goto fail;
   helper = &fbdev->base;
   drm_fb_helper_prepare(dev, helper, &msm_fb_helper_funcs);
-  ret = drm_fb_helper_init(dev, helper, priv->num_crtcs, priv->num_connectors);
+  ret = drm_fb_helper_init(dev, helper, priv->num_connectors);
   if (ret) {
     dev_err(dev->dev, "could not init fbdev: ret=%d\n", ret);
     goto fail;
   }
   ret = drm_fb_helper_single_add_all_connectors(helper);
   if (ret) goto fini;
   ret = drm_fb_helper_initial_config(helper, 32);
   if (ret) goto fini;
   priv->fbdev = helper;
   return helper;
 fini:
   drm_fb_helper_fini(helper);
 fail:
   kfree(fbdev);
   return NULL;
 }<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,74 +1,74 @@
 static int mxsfb_load(struct drm_device *drm, unsigned long flags) {
   struct platform_device *pdev = to_platform_device(drm->dev);
   struct mxsfb_drm_private *mxsfb;
   struct resource *res;
   int ret;
   mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL);
   if (!mxsfb) return -ENOMEM;
   drm->dev_private = mxsfb;
   mxsfb->devdata = &mxsfb_devdata[pdev->id_entry->driver_data];
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   mxsfb->base = devm_ioremap_resource(drm->dev, res);
   if (IS_ERR(mxsfb->base)) return PTR_ERR(mxsfb->base);
   mxsfb->clk = devm_clk_get(drm->dev, NULL);
   if (IS_ERR(mxsfb->clk)) return PTR_ERR(mxsfb->clk);
   mxsfb->clk_axi = devm_clk_get(drm->dev, "axi");
   if (IS_ERR(mxsfb->clk_axi)) mxsfb->clk_axi = NULL;
   mxsfb->clk_disp_axi = devm_clk_get(drm->dev, "disp_axi");
   if (IS_ERR(mxsfb->clk_disp_axi)) mxsfb->clk_disp_axi = NULL;
   ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32));
   if (ret) return ret;
   pm_runtime_enable(drm->dev);
   ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
   if (ret < 0) {
     dev_err(drm->dev, "Failed to initialise vblank\n");
     goto err_vblank;
   }
   /* Modeset init */
   drm_mode_config_init(drm);
   ret = mxsfb_create_output(drm);
   if (ret < 0) {
     dev_err(drm->dev, "Failed to create outputs\n");
     goto err_vblank;
   }
   ret = drm_simple_display_pipe_init(drm, &mxsfb->pipe, &mxsfb_funcs, mxsfb_formats, ARRAY_SIZE(mxsfb_formats), &mxsfb->connector);
   if (ret < 0) {
     dev_err(drm->dev, "Cannot setup simple display pipe\n");
     goto err_vblank;
   }
   ret = drm_panel_attach(mxsfb->panel, &mxsfb->connector);
   if (ret) {
     dev_err(drm->dev, "Cannot connect panel\n");
     goto err_vblank;
   }
   drm->mode_config.min_width = MXSFB_MIN_XRES;
   drm->mode_config.min_height = MXSFB_MIN_YRES;
   drm->mode_config.max_width = MXSFB_MAX_XRES;
   drm->mode_config.max_height = MXSFB_MAX_YRES;
   drm->mode_config.funcs = &mxsfb_mode_config_funcs;
   drm_mode_config_reset(drm);
   pm_runtime_get_sync(drm->dev);
   ret = drm_irq_install(drm, platform_get_irq(pdev, 0));
   pm_runtime_put_sync(drm->dev);
   if (ret < 0) {
     dev_err(drm->dev, "Failed to install IRQ handler\n");
     goto err_irq;
   }
   drm_kms_helper_poll_init(drm);
-  mxsfb->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc, drm->mode_config.num_connector);
+  mxsfb->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_connector);
   if (IS_ERR(mxsfb->fbdev)) {
     mxsfb->fbdev = NULL;
     dev_err(drm->dev, "Failed to init FB CMA area\n");
     goto err_cma;
   }
   platform_set_drvdata(pdev, drm);
   drm_helper_hpd_irq_event(drm);
   return 0;
 err_cma:
   drm_irq_uninstall(drm);
 err_irq:
   drm_panel_detach(mxsfb->panel);
 err_vblank:
   pm_runtime_disable(drm->dev);
   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,32 +1,32 @@
 int nouveau_fbcon_init(struct drm_device *dev) {
   struct nouveau_drm *drm = nouveau_drm(dev);
   struct nouveau_fbdev *fbcon;
   int preferred_bpp;
   int ret;
   if (!dev->mode_config.num_crtc || (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) return 0;
   fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
   if (!fbcon) return -ENOMEM;
   drm->fbcon = fbcon;
   drm_fb_helper_prepare(dev, &fbcon->helper, &nouveau_fbcon_helper_funcs);
-  ret = drm_fb_helper_init(dev, &fbcon->helper, dev->mode_config.num_crtc, 4);
+  ret = drm_fb_helper_init(dev, &fbcon->helper, 4);
   if (ret) goto free;
   ret = drm_fb_helper_single_add_all_connectors(&fbcon->helper);
   if (ret) goto fini;
   if (drm->device.info.ram_size <= 32 * 1024 * 1024)
     preferred_bpp = 8;
   else if (drm->device.info.ram_size <= 64 * 1024 * 1024)
     preferred_bpp = 16;
   else
     preferred_bpp = 32;
   /* disable all the possible outputs/crtcs before entering KMS mode */
   if (!drm_drv_uses_atomic_modeset(dev)) drm_helper_disable_unused_functions(dev);
   ret = drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp);
   if (ret) goto fini;
   if (fbcon->helper.fbdev) fbcon->helper.fbdev->pixmap.buf_align = 4;
   return 0;
 fini:
   drm_fb_helper_fini(&fbcon->helper);
 free:
   kfree(fbcon);
   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,29 +1,29 @@
 struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev) {
   struct omap_drm_private *priv = dev->dev_private;
   struct omap_fbdev *fbdev = NULL;
   struct drm_fb_helper *helper;
   int ret = 0;
   fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
   if (!fbdev) goto fail;
   INIT_WORK(&fbdev->work, pan_worker);
   helper = &fbdev->base;
   drm_fb_helper_prepare(dev, helper, &omap_fb_helper_funcs);
-  ret = drm_fb_helper_init(dev, helper, priv->num_crtcs, priv->num_connectors);
+  ret = drm_fb_helper_init(dev, helper, priv->num_connectors);
   if (ret) {
     dev_err(dev->dev, "could not init fbdev: ret=%d\n", ret);
     goto fail;
   }
   ret = drm_fb_helper_single_add_all_connectors(helper);
   if (ret) goto fini;
   ret = drm_fb_helper_initial_config(helper, 32);
   if (ret) goto fini;
   priv->fbdev = helper;
   return helper;
 fini:
   drm_fb_helper_fini(helper);
 fail:
   kfree(fbdev);
   dev_warn(dev->dev, "omap_fbdev_init failed\n");
   /* well, limp along without an fbdev.. maybe X11 will work? */
   return NULL;
 }<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,24 +1,24 @@
 int qxl_fbdev_init(struct qxl_device *qdev) {
   struct qxl_fbdev *qfbdev;
   int bpp_sel = 32; /* TODO: parameter from somewhere? */
   int ret;
   qfbdev = kzalloc(sizeof(struct qxl_fbdev), GFP_KERNEL);
   if (!qfbdev) return -ENOMEM;
   qfbdev->qdev = qdev;
   qdev->mode_info.qfbdev = qfbdev;
   spin_lock_init(&qfbdev->delayed_ops_lock);
   INIT_LIST_HEAD(&qfbdev->delayed_ops);
   drm_fb_helper_prepare(&qdev->ddev, &qfbdev->helper, &qxl_fb_helper_funcs);
-  ret = drm_fb_helper_init(&qdev->ddev, &qfbdev->helper, qxl_num_crtc, QXLFB_CONN_LIMIT);
+  ret = drm_fb_helper_init(&qdev->ddev, &qfbdev->helper, QXLFB_CONN_LIMIT);
   if (ret) goto free;
   ret = drm_fb_helper_single_add_all_connectors(&qfbdev->helper);
   if (ret) goto fini;
   ret = drm_fb_helper_initial_config(&qfbdev->helper, bpp_sel);
   if (ret) goto fini;
   return 0;
 fini:
   drm_fb_helper_fini(&qfbdev->helper);
 free:
   kfree(qfbdev);
   return ret;
 }<sep>@r@
expression A,B,D,E;
identifier C;
@@
(
- 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,28 +1,28 @@
 int radeon_fbdev_init(struct radeon_device *rdev) {
   struct radeon_fbdev *rfbdev;
   int bpp_sel = 32;
   int ret;
   /* don't enable fbdev if no connectors */
   if (list_empty(&rdev->ddev->mode_config.connector_list)) return 0;
   /* select 8 bpp console on RN50 or 16MB cards */
   if (ASIC_IS_RN50(rdev) || rdev->mc.real_vram_size <= (32 * 1024 * 1024)) bpp_sel = 8;
   rfbdev = kzalloc(sizeof(struct radeon_fbdev), GFP_KERNEL);
   if (!rfbdev) return -ENOMEM;
   rfbdev->rdev = rdev;
   rdev->mode_info.rfbdev = rfbdev;
   drm_fb_helper_prepare(rdev->ddev, &rfbdev->helper, &radeon_fb_helper_funcs);
-  ret = drm_fb_helper_init(rdev->ddev, &rfbdev->helper, rdev->num_crtc, RADEONFB_CONN_LIMIT);
+  ret = drm_fb_helper_init(rdev->ddev, &rfbdev->helper, RADEONFB_CONN_LIMIT);
   if (ret) goto free;
   ret = drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
   if (ret) goto fini;
   /* disable all the possible outputs/crtcs before entering KMS mode */
   drm_helper_disable_unused_functions(rdev->ddev);
   ret = drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);
   if (ret) goto fini;
   return 0;
 fini:
   drm_fb_helper_fini(&rfbdev->helper);
 free:
   kfree(rfbdev);
   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,29 +1,27 @@
 int rockchip_drm_fbdev_init(struct drm_device *dev) {
   struct rockchip_drm_private *private = dev->dev_private;
   struct drm_fb_helper *helper;
-  unsigned int num_crtc;
   int ret;
   if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector) return -EINVAL;
-  num_crtc = dev->mode_config.num_crtc;
   helper = &private->fbdev_helper;
   drm_fb_helper_prepare(dev, helper, &rockchip_drm_fb_helper_funcs);
-  ret = drm_fb_helper_init(dev, helper, num_crtc, ROCKCHIP_MAX_CONNECTOR);
+  ret = drm_fb_helper_init(dev, helper, ROCKCHIP_MAX_CONNECTOR);
   if (ret < 0) {
     dev_err(dev->dev, "Failed to initialize drm fb helper - %d.\n", ret);
     return ret;
   }
   ret = drm_fb_helper_single_add_all_connectors(helper);
   if (ret < 0) {
     dev_err(dev->dev, "Failed to add connectors - %d.\n", ret);
     goto err_drm_fb_helper_fini;
   }
   ret = drm_fb_helper_initial_config(helper, PREFERRED_BPP);
   if (ret < 0) {
     dev_err(dev->dev, "Failed to set initial hw config - %d.\n", ret);
     goto err_drm_fb_helper_fini;
   }
   return 0;
 err_drm_fb_helper_fini:
   drm_fb_helper_fini(helper);
   return ret;
 }<sep>@r@
expression A,B,D,E;
identifier C;
@@
(
- 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)
)

@@
identifier r.C;
type T;
expression V;
@@
- T C;
<...
when != C
- C = V;
...>
--- initial
+++ final
@@ -1,35 +1,35 @@
 static int sti_bind(struct device *dev) {
   struct drm_device *ddev;
   struct sti_private *private;
   struct drm_fbdev_cma *fbdev;
   int ret;
   ddev = drm_dev_alloc(&sti_driver, dev);
   if (IS_ERR(ddev)) return PTR_ERR(ddev);
   ddev->platformdev = to_platform_device(dev);
   ret = sti_init(ddev);
   if (ret) goto err_drm_dev_unref;
   ret = component_bind_all(ddev->dev, ddev);
   if (ret) goto err_cleanup;
   ret = drm_dev_register(ddev, 0);
   if (ret) goto err_register;
   drm_mode_config_reset(ddev);
 private
   = ddev->dev_private;
   if (ddev->mode_config.num_connector) {
-    fbdev = drm_fbdev_cma_init(ddev, 32, ddev->mode_config.num_crtc, ddev->mode_config.num_connector);
+    fbdev = drm_fbdev_cma_init(ddev, 32, ddev->mode_config.num_connector);
     if (IS_ERR(fbdev)) {
       DRM_DEBUG_DRIVER("Warning: fails to create fbdev\n");
       fbdev = NULL;
     }
   private
     ->fbdev = fbdev;
   }
   return 0;
 err_register:
   drm_mode_config_cleanup(ddev);
 err_cleanup:
   sti_cleanup(ddev);
 err_drm_dev_unref:
   drm_dev_unref(ddev);
   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,7 +1,7 @@
 struct drm_fbdev_cma *sun4i_framebuffer_init(struct drm_device *drm) {
   drm_mode_config_reset(drm);
   drm->mode_config.max_width = 8192;
   drm->mode_config.max_height = 8192;
   drm->mode_config.funcs = &sun4i_de_mode_config_funcs;
-  return drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc, drm->mode_config.num_connector);
+  return drm_fbdev_cma_init(drm, 32, drm->mode_config.num_connector);
 }<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,24 +1,24 @@
 int udl_fbdev_init(struct drm_device *dev) {
   struct udl_device *udl = dev->dev_private;
   int bpp_sel = fb_bpp;
   struct udl_fbdev *ufbdev;
   int ret;
   ufbdev = kzalloc(sizeof(struct udl_fbdev), GFP_KERNEL);
   if (!ufbdev) return -ENOMEM;
   udl->fbdev = ufbdev;
   drm_fb_helper_prepare(dev, &ufbdev->helper, &udl_fb_helper_funcs);
-  ret = drm_fb_helper_init(dev, &ufbdev->helper, 1, 1);
+  ret = drm_fb_helper_init(dev, &ufbdev->helper, 1);
   if (ret) goto free;
   ret = drm_fb_helper_single_add_all_connectors(&ufbdev->helper);
   if (ret) goto fini;
   /* disable all the possible outputs/crtcs before entering KMS mode */
   drm_helper_disable_unused_functions(dev);
   ret = drm_fb_helper_initial_config(&ufbdev->helper, bpp_sel);
   if (ret) goto fini;
   return 0;
 fini:
   drm_fb_helper_fini(&ufbdev->helper);
 free:
   kfree(ufbdev);
   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)
)