imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,41 +1,39 @@
 static int ice40_fpga_probe(struct spi_device *spi) {
   struct device *dev = &spi->dev;
   struct ice40_fpga_priv *priv;
   struct fpga_manager *mgr;
   int ret;
   priv = devm_kzalloc(&spi->dev, sizeof(*priv), GFP_KERNEL);
   if (!priv) return -ENOMEM;
   priv->dev = spi;
   /* Check board setup data. */
   if (spi->max_speed_hz > ICE40_SPI_MAX_SPEED) {
     dev_err(dev, "SPI speed is too high, maximum speed is " __stringify(ICE40_SPI_MAX_SPEED) "\n");
     return -EINVAL;
   }
   if (spi->max_speed_hz < ICE40_SPI_MIN_SPEED) {
     dev_err(dev, "SPI speed is too low, minimum speed is " __stringify(ICE40_SPI_MIN_SPEED) "\n");
     return -EINVAL;
   }
   if (spi->mode & SPI_CPHA) {
     dev_err(dev, "Bad SPI mode, CPHA not supported\n");
     return -EINVAL;
   }
   /* Set up the GPIOs */
   priv->cdone = devm_gpiod_get(dev, "cdone", GPIOD_IN);
   if (IS_ERR(priv->cdone)) {
     ret = PTR_ERR(priv->cdone);
     dev_err(dev, "Failed to get CDONE GPIO: %d\n", ret);
     return ret;
   }
   priv->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
   if (IS_ERR(priv->reset)) {
     ret = PTR_ERR(priv->reset);
     dev_err(dev, "Failed to get CRESET_B GPIO: %d\n", ret);
     return ret;
   }
-  mgr = fpga_mgr_create(dev, "Lattice iCE40 FPGA Manager", &ice40_fpga_ops, priv);
+  mgr = devm_fpga_mgr_create(dev, "Lattice iCE40 FPGA Manager", &ice40_fpga_ops, priv);
   if (!mgr) return -ENOMEM;
   spi_set_drvdata(spi, mgr);
-  ret = fpga_mgr_register(mgr);
-  if (ret) fpga_mgr_free(mgr);
-  return ret;
+  return fpga_mgr_register(mgr);
 }<sep>@@
expression mgr,ret,e1,e2,e3,e4;
@@

	mgr =
-           fpga_mgr_create
+           devm_fpga_mgr_create
		(e1,e2,e3,e4);
	... 
-       ret = fpga_mgr_register(mgr);
-       if (ret)
-               fpga_mgr_free(mgr);
-
-       return ret;
+       return fpga_mgr_register(mgr);
--- initial
+++ final
@@ -1,15 +1,12 @@
 static int machxo2_spi_probe(struct spi_device *spi) {
   struct device *dev = &spi->dev;
   struct fpga_manager *mgr;
-  int ret;
   if (spi->max_speed_hz > MACHXO2_MAX_SPEED) {
     dev_err(dev, "Speed is too high\n");
     return -EINVAL;
   }
-  mgr = fpga_mgr_create(dev, "Lattice MachXO2 SPI FPGA Manager", &machxo2_ops, spi);
+  mgr = devm_fpga_mgr_create(dev, "Lattice MachXO2 SPI FPGA Manager", &machxo2_ops, spi);
   if (!mgr) return -ENOMEM;
   spi_set_drvdata(spi, mgr);
-  ret = fpga_mgr_register(mgr);
-  if (ret) fpga_mgr_free(mgr);
-  return ret;
+  return fpga_mgr_register(mgr);
 }<sep>@@
expression mgr,e1,e2,e3,e4;
identifier ret;
type T;
@@

(
-	T ret;
	...
	mgr =
-           fpga_mgr_create
+           devm_fpga_mgr_create
		(e1,e2,e3,e4);
	... when != ret
-       ret = fpga_mgr_register(mgr);
-       if (ret)
-               fpga_mgr_free(mgr);
-
-       return ret;
+       return fpga_mgr_register(mgr);
&
	T ret;
	... when != ret
	    when strict
?       ret = fpga_mgr_register(mgr);
)
--- initial
+++ final
@@ -1,41 +1,40 @@
 static int socfpga_a10_fpga_probe(struct platform_device *pdev) {
   struct device *dev = &pdev->dev;
   struct a10_fpga_priv *priv;
   void __iomem *reg_base;
   struct fpga_manager *mgr;
   struct resource *res;
   int ret;
   priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
   if (!priv) return -ENOMEM;
   /* First mmio base is for register access */
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   reg_base = devm_ioremap_resource(dev, res);
   if (IS_ERR(reg_base)) return PTR_ERR(reg_base);
   /* Second mmio base is for writing FPGA image data */
   res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
   priv->fpga_data_addr = devm_ioremap_resource(dev, res);
   if (IS_ERR(priv->fpga_data_addr)) return PTR_ERR(priv->fpga_data_addr);
   /* regmap for register access */
   priv->regmap = devm_regmap_init_mmio(dev, reg_base, &socfpga_a10_fpga_regmap_config);
   if (IS_ERR(priv->regmap)) return -ENODEV;
   priv->clk = devm_clk_get(dev, NULL);
   if (IS_ERR(priv->clk)) {
     dev_err(dev, "no clock specified\n");
     return PTR_ERR(priv->clk);
   }
   ret = clk_prepare_enable(priv->clk);
   if (ret) {
     dev_err(dev, "could not enable clock\n");
     return -EBUSY;
   }
-  mgr = fpga_mgr_create(dev, "SoCFPGA Arria10 FPGA Manager", &socfpga_a10_fpga_mgr_ops, priv);
+  mgr = devm_fpga_mgr_create(dev, "SoCFPGA Arria10 FPGA Manager", &socfpga_a10_fpga_mgr_ops, priv);
   if (!mgr) return -ENOMEM;
   platform_set_drvdata(pdev, mgr);
   ret = fpga_mgr_register(mgr);
   if (ret) {
-    fpga_mgr_free(mgr);
     clk_disable_unprepare(priv->clk);
     return ret;
   }
   return 0;
 }<sep>@@
expression mgr,ret,e1,e2,e3,e4;
@@

	mgr =
-           fpga_mgr_create
+           devm_fpga_mgr_create
		(e1,e2,e3,e4);
	... 
        ret = fpga_mgr_register(mgr);
        if (ret)
	{
		...
-               fpga_mgr_free(mgr);
		...
	}
--- initial
+++ final
@@ -1,25 +1,23 @@
 static int socfpga_fpga_probe(struct platform_device *pdev) {
   struct device *dev = &pdev->dev;
   struct socfpga_fpga_priv *priv;
   struct fpga_manager *mgr;
   struct resource *res;
   int ret;
   priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
   if (!priv) return -ENOMEM;
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   priv->fpga_base_addr = devm_ioremap_resource(dev, res);
   if (IS_ERR(priv->fpga_base_addr)) return PTR_ERR(priv->fpga_base_addr);
   res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
   priv->fpga_data_addr = devm_ioremap_resource(dev, res);
   if (IS_ERR(priv->fpga_data_addr)) return PTR_ERR(priv->fpga_data_addr);
   priv->irq = platform_get_irq(pdev, 0);
   if (priv->irq < 0) return priv->irq;
   ret = devm_request_irq(dev, priv->irq, socfpga_fpga_isr, 0, dev_name(dev), priv);
   if (ret) return ret;
-  mgr = fpga_mgr_create(dev, "Altera SOCFPGA FPGA Manager", &socfpga_fpga_ops, priv);
+  mgr = devm_fpga_mgr_create(dev, "Altera SOCFPGA FPGA Manager", &socfpga_fpga_ops, priv);
   if (!mgr) return -ENOMEM;
   platform_set_drvdata(pdev, mgr);
-  ret = fpga_mgr_register(mgr);
-  if (ret) fpga_mgr_free(mgr);
-  return ret;
+  return fpga_mgr_register(mgr);
 }<sep>@@
expression mgr,ret,e1,e2,e3,e4;
@@

	mgr =
-           fpga_mgr_create
+           devm_fpga_mgr_create
		(e1,e2,e3,e4);
	... 
-       ret = fpga_mgr_register(mgr);
-       if (ret)
-               fpga_mgr_free(mgr);
-
-       return ret;
+       return fpga_mgr_register(mgr);
--- initial
+++ final
@@ -1,22 +1,19 @@
 static int ts73xx_fpga_probe(struct platform_device *pdev) {
   struct device *kdev = &pdev->dev;
   struct ts73xx_fpga_priv *priv;
   struct fpga_manager *mgr;
   struct resource *res;
-  int ret;
   priv = devm_kzalloc(kdev, sizeof(*priv), GFP_KERNEL);
   if (!priv) return -ENOMEM;
   priv->dev = kdev;
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   priv->io_base = devm_ioremap_resource(kdev, res);
   if (IS_ERR(priv->io_base)) {
     dev_err(kdev, "unable to remap registers\n");
     return PTR_ERR(priv->io_base);
   }
-  mgr = fpga_mgr_create(kdev, "TS-73xx FPGA Manager", &ts73xx_fpga_ops, priv);
+  mgr = devm_fpga_mgr_create(kdev, "TS-73xx FPGA Manager", &ts73xx_fpga_ops, priv);
   if (!mgr) return -ENOMEM;
   platform_set_drvdata(pdev, mgr);
-  ret = fpga_mgr_register(mgr);
-  if (ret) fpga_mgr_free(mgr);
-  return ret;
+  return fpga_mgr_register(mgr);
 }<sep>@@
expression mgr,e1,e2,e3,e4;
identifier ret;
type T;
@@

(
-	T ret;
	...
	mgr =
-           fpga_mgr_create
+           devm_fpga_mgr_create
		(e1,e2,e3,e4);
	... when != ret
-       ret = fpga_mgr_register(mgr);
-       if (ret)
-               fpga_mgr_free(mgr);
-
-       return ret;
+       return fpga_mgr_register(mgr);
&
	T ret;
	... when != ret
	    when strict
?       ret = fpga_mgr_register(mgr);
)
--- initial
+++ final
@@ -1,25 +1,22 @@
 static int xilinx_spi_probe(struct spi_device *spi) {
   struct xilinx_spi_conf *conf;
   struct fpga_manager *mgr;
-  int ret;
   conf = devm_kzalloc(&spi->dev, sizeof(*conf), GFP_KERNEL);
   if (!conf) return -ENOMEM;
   conf->spi = spi;
   /* PROGRAM_B is active low */
   conf->prog_b = devm_gpiod_get(&spi->dev, "prog_b", GPIOD_OUT_LOW);
   if (IS_ERR(conf->prog_b)) {
     dev_err(&spi->dev, "Failed to get PROGRAM_B gpio: %ld\n", PTR_ERR(conf->prog_b));
     return PTR_ERR(conf->prog_b);
   }
   conf->done = devm_gpiod_get(&spi->dev, "done", GPIOD_IN);
   if (IS_ERR(conf->done)) {
     dev_err(&spi->dev, "Failed to get DONE gpio: %ld\n", PTR_ERR(conf->done));
     return PTR_ERR(conf->done);
   }
-  mgr = fpga_mgr_create(&spi->dev, "Xilinx Slave Serial FPGA Manager", &xilinx_spi_ops, conf);
+  mgr = devm_fpga_mgr_create(&spi->dev, "Xilinx Slave Serial FPGA Manager", &xilinx_spi_ops, conf);
   if (!mgr) return -ENOMEM;
   spi_set_drvdata(spi, mgr);
-  ret = fpga_mgr_register(mgr);
-  if (ret) fpga_mgr_free(mgr);
-  return ret;
+  return fpga_mgr_register(mgr);
 }<sep>@@
expression mgr,e1,e2,e3,e4;
identifier ret;
type T;
@@

(
-	T ret;
	...
	mgr =
-           fpga_mgr_create
+           devm_fpga_mgr_create
		(e1,e2,e3,e4);
	... when != ret
-       ret = fpga_mgr_register(mgr);
-       if (ret)
-               fpga_mgr_free(mgr);
-
-       return ret;
+       return fpga_mgr_register(mgr);
&
	T ret;
	... when != ret
	    when strict
?       ret = fpga_mgr_register(mgr);
)
--- initial
+++ final
@@ -1,56 +1,55 @@
 static int zynq_fpga_probe(struct platform_device *pdev) {
   struct device *dev = &pdev->dev;
   struct zynq_fpga_priv *priv;
   struct fpga_manager *mgr;
   struct resource *res;
   int err;
   priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
   if (!priv) return -ENOMEM;
   spin_lock_init(&priv->dma_lock);
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   priv->io_base = devm_ioremap_resource(dev, res);
   if (IS_ERR(priv->io_base)) return PTR_ERR(priv->io_base);
   priv->slcr = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon");
   if (IS_ERR(priv->slcr)) {
     dev_err(dev, "unable to get zynq-slcr regmap\n");
     return PTR_ERR(priv->slcr);
   }
   init_completion(&priv->dma_done);
   priv->irq = platform_get_irq(pdev, 0);
   if (priv->irq < 0) {
     dev_err(dev, "No IRQ available\n");
     return priv->irq;
   }
   priv->clk = devm_clk_get(dev, "ref_clk");
   if (IS_ERR(priv->clk)) {
     dev_err(dev, "input clock not found\n");
     return PTR_ERR(priv->clk);
   }
   err = clk_prepare_enable(priv->clk);
   if (err) {
     dev_err(dev, "unable to enable clock\n");
     return err;
   }
   /* unlock the device */
   zynq_fpga_write(priv, UNLOCK_OFFSET, UNLOCK_MASK);
   zynq_fpga_set_irq(priv, 0);
   zynq_fpga_write(priv, INT_STS_OFFSET, IXR_ALL_MASK);
   err = devm_request_irq(dev, priv->irq, zynq_fpga_isr, 0, dev_name(dev), priv);
   if (err) {
     dev_err(dev, "unable to request IRQ\n");
     clk_disable_unprepare(priv->clk);
     return err;
   }
   clk_disable(priv->clk);
-  mgr = fpga_mgr_create(dev, "Xilinx Zynq FPGA Manager", &zynq_fpga_ops, priv);
+  mgr = devm_fpga_mgr_create(dev, "Xilinx Zynq FPGA Manager", &zynq_fpga_ops, priv);
   if (!mgr) return -ENOMEM;
   platform_set_drvdata(pdev, mgr);
   err = fpga_mgr_register(mgr);
   if (err) {
     dev_err(dev, "unable to register FPGA manager\n");
-    fpga_mgr_free(mgr);
     clk_unprepare(priv->clk);
     return err;
   }
   return 0;
 }<sep>@@
expression mgr,ret,e1,e2,e3,e4;
@@

	mgr =
-           fpga_mgr_create
+           devm_fpga_mgr_create
		(e1,e2,e3,e4);
	... 
        ret = fpga_mgr_register(mgr);
        if (ret)
	{
		...
-               fpga_mgr_free(mgr);
		...
	}
--- initial
+++ final
@@ -1,19 +1,19 @@
 static int tvc_connect(struct omap_dss_device *dssdev) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in;
   int r;
   dev_dbg(ddata->dev, "connect\n");
   if (omapdss_device_is_connected(dssdev)) return 0;
   in = omapdss_of_find_source_for_first_ep(ddata->dev->of_node);
   if (IS_ERR(in)) {
     dev_err(ddata->dev, "failed to find video source\n");
     return PTR_ERR(in);
   }
-  r = in->ops->connect(in, dssdev);
+  r = omapdss_device_connect(in, dssdev);
   if (r) {
     omap_dss_put_device(in);
     return r;
   }
   ddata->in = in;
   return 0;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@

-       in->ops->connect
+       omapdss_device_connect
		(in, dssdev)
--- initial
+++ final
@@ -1,9 +1,9 @@
 static void tvc_disconnect(struct omap_dss_device *dssdev) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in = ddata->in;
   dev_dbg(ddata->dev, "disconnect\n");
   if (!omapdss_device_is_connected(dssdev)) return;
-  in->ops->disconnect(in, dssdev);
+  omapdss_device_disconnect(in, dssdev);
   omap_dss_put_device(in);
   ddata->in = NULL;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@
-       in->ops->disconnect
+       omapdss_device_disconnect
		(in, dssdev)
--- initial
+++ final
@@ -1,18 +1,18 @@
 static int dvic_connect(struct omap_dss_device *dssdev) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in;
   int r;
   if (omapdss_device_is_connected(dssdev)) return 0;
   in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
   if (IS_ERR(in)) {
     dev_err(dssdev->dev, "failed to find video source\n");
     return PTR_ERR(in);
   }
-  r = in->ops->connect(in, dssdev);
+  r = omapdss_device_connect(in, dssdev);
   if (r) {
     omap_dss_put_device(in);
     return r;
   }
   ddata->in = in;
   return 0;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@

-       in->ops->connect
+       omapdss_device_connect
		(in, dssdev)
--- initial
+++ final
@@ -1,8 +1,8 @@
 static void dvic_disconnect(struct omap_dss_device *dssdev) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in = ddata->in;
   if (!omapdss_device_is_connected(dssdev)) return;
-  in->ops->disconnect(in, dssdev);
+  omapdss_device_disconnect(in, dssdev);
   omap_dss_put_device(in);
   ddata->in = NULL;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@
-       in->ops->disconnect
+       omapdss_device_disconnect
		(in, dssdev)
--- initial
+++ final
@@ -1,19 +1,19 @@
 static int hdmic_connect(struct omap_dss_device *dssdev) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in;
   int r;
   dev_dbg(ddata->dev, "connect\n");
   if (omapdss_device_is_connected(dssdev)) return 0;
   in = omapdss_of_find_source_for_first_ep(ddata->dev->of_node);
   if (IS_ERR(in)) {
     dev_err(ddata->dev, "failed to find video source\n");
     return PTR_ERR(in);
   }
-  r = in->ops->connect(in, dssdev);
+  r = omapdss_device_connect(in, dssdev);
   if (r) {
     omap_dss_put_device(in);
     return r;
   }
   ddata->in = in;
   return 0;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@

-       in->ops->connect
+       omapdss_device_connect
		(in, dssdev)
--- initial
+++ final
@@ -1,9 +1,9 @@
 static void hdmic_disconnect(struct omap_dss_device *dssdev) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in = ddata->in;
   dev_dbg(ddata->dev, "disconnect\n");
   if (!omapdss_device_is_connected(dssdev)) return;
-  in->ops->disconnect(in, dssdev);
+  omapdss_device_disconnect(in, dssdev);
   omap_dss_put_device(in);
   ddata->in = NULL;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@
-       in->ops->disconnect
+       omapdss_device_disconnect
		(in, dssdev)
--- initial
+++ final
@@ -1,21 +1,21 @@
 static int opa362_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in;
   int r;
   dev_dbg(dssdev->dev, "connect\n");
   if (omapdss_device_is_connected(dssdev)) return -EBUSY;
   in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
   if (IS_ERR(in)) {
     dev_err(dssdev->dev, "failed to find video source\n");
     return PTR_ERR(in);
   }
-  r = in->ops->connect(in, dssdev);
+  r = omapdss_device_connect(in, dssdev);
   if (r) {
     omap_dss_put_device(in);
     return r;
   }
   dst->src = dssdev;
   dssdev->dst = dst;
   ddata->in = in;
   return 0;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@

-       in->ops->connect
+       omapdss_device_connect
		(in, dssdev)
--- initial
+++ final
@@ -1,14 +1,14 @@
 static void opa362_disconnect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in = ddata->in;
   dev_dbg(dssdev->dev, "disconnect\n");
   WARN_ON(!omapdss_device_is_connected(dssdev));
   if (!omapdss_device_is_connected(dssdev)) return;
   WARN_ON(dst != dssdev->dst);
   if (dst != dssdev->dst) return;
   dst->src = NULL;
   dssdev->dst = NULL;
-  in->ops->disconnect(in, &ddata->dssdev);
+  omapdss_device_disconnect(in, &ddata->dssdev);
   omap_dss_put_device(in);
   ddata->in = NULL;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@
-       in->ops->disconnect
+       omapdss_device_disconnect
		(in, dssdev)
--- initial
+++ final
@@ -1,20 +1,20 @@
 static int tfp410_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in;
   int r;
   if (omapdss_device_is_connected(dssdev)) return -EBUSY;
   in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
   if (IS_ERR(in)) {
     dev_err(dssdev->dev, "failed to find video source\n");
     return PTR_ERR(in);
   }
-  r = in->ops->connect(in, dssdev);
+  r = omapdss_device_connect(in, dssdev);
   if (r) {
     omap_dss_put_device(in);
     return r;
   }
   dst->src = dssdev;
   dssdev->dst = dst;
   ddata->in = in;
   return 0;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@

-       in->ops->connect
+       omapdss_device_connect
		(in, dssdev)
--- initial
+++ final
@@ -1,13 +1,13 @@
 static void tfp410_disconnect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in = ddata->in;
   WARN_ON(!omapdss_device_is_connected(dssdev));
   if (!omapdss_device_is_connected(dssdev)) return;
   WARN_ON(dst != dssdev->dst);
   if (dst != dssdev->dst) return;
   dst->src = NULL;
   dssdev->dst = NULL;
-  in->ops->disconnect(in, &ddata->dssdev);
+  omapdss_device_disconnect(in, &ddata->dssdev);
   omap_dss_put_device(in);
   ddata->in = NULL;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@
-       in->ops->disconnect
+       omapdss_device_disconnect
		(in, dssdev)
--- initial
+++ final
@@ -1,23 +1,23 @@
 static int tpd_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in;
   int r;
   in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
   if (IS_ERR(in)) {
     dev_err(dssdev->dev, "failed to find video source\n");
     return PTR_ERR(in);
   }
-  r = in->ops->connect(in, dssdev);
+  r = omapdss_device_connect(in, dssdev);
   if (r) {
     omap_dss_put_device(in);
     return r;
   }
   dst->src = dssdev;
   dssdev->dst = dst;
   gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 1);
   gpiod_set_value_cansleep(ddata->ls_oe_gpio, 1);
   /* DC-DC converter needs at max 300us to get to 90% of 5V */
   udelay(300);
   ddata->in = in;
   return 0;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@

-       in->ops->connect
+       omapdss_device_connect
		(in, dssdev)
--- initial
+++ final
@@ -1,13 +1,13 @@
 static void tpd_disconnect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in = ddata->in;
   WARN_ON(dst != dssdev->dst);
   if (dst != dssdev->dst) return;
   gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 0);
   gpiod_set_value_cansleep(ddata->ls_oe_gpio, 0);
   dst->src = NULL;
   dssdev->dst = NULL;
-  in->ops->disconnect(in, &ddata->dssdev);
+  omapdss_device_disconnect(in, &ddata->dssdev);
   omap_dss_put_device(in);
   ddata->in = NULL;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@
-       in->ops->disconnect
+       omapdss_device_disconnect
		(in, dssdev)
--- initial
+++ final
@@ -1,33 +1,33 @@
 static int omap_connect_dssdevs(struct drm_device *ddev) {
   struct omap_drm_private *priv = ddev->dev_private;
   struct omap_dss_device *dssdev = NULL;
   int r;
   if (!omapdss_stack_is_ready()) return -EPROBE_DEFER;
   for_each_dss_dev(dssdev) {
-    r = dssdev->driver->connect(dssdev);
+    r = omapdss_device_connect(dssdev, NULL);
     if (r == -EPROBE_DEFER) {
       omap_dss_put_device(dssdev);
       goto cleanup;
     } else if (r) {
       dev_warn(dssdev->dev, "could not connect display: %s\n", dssdev->name);
     } else {
       omap_dss_get_device(dssdev);
       priv->dssdevs[priv->num_dssdevs++] = dssdev;
       if (priv->num_dssdevs == ARRAY_SIZE(priv->dssdevs)) {
         /* To balance the 'for_each_dss_dev' loop */
         omap_dss_put_device(dssdev);
         break;
       }
     }
   }
   /* Sort the list by DT aliases */
   sort(priv->dssdevs, priv->num_dssdevs, sizeof(priv->dssdevs[0]), omap_compare_dssdevs, NULL);
   return 0;
 cleanup:
   /*
    * if we are deferring probe, we disconnect the devices we previously
    * connected
    */
   omap_disconnect_dssdevs(ddev);
   return r;
 }<sep>@@
struct omap_dss_device *in;
@@

-       in->driver->connect(in)
+       omapdss_device_connect(in, NULL)
--- initial
+++ final
@@ -1,11 +1,11 @@
 static void omap_disconnect_dssdevs(struct drm_device *ddev) {
   struct omap_drm_private *priv = ddev->dev_private;
   unsigned int i;
   for (i = 0; i < priv->num_dssdevs; i++) {
     struct omap_dss_device *dssdev = priv->dssdevs[i];
-    dssdev->driver->disconnect(dssdev);
+    omapdss_device_disconnect(dssdev, NULL);
     priv->dssdevs[i] = NULL;
     omap_dss_put_device(dssdev);
   }
   priv->num_dssdevs = 0;
 }<sep>@@
struct omap_dss_device *in;
@@
-       in->driver->disconnect(in)
+       omapdss_device_disconnect(in, NULL)
--- initial
+++ final
@@ -1,18 +1,18 @@
 static int panel_dpi_connect(struct omap_dss_device *dssdev) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in;
   int r;
   if (omapdss_device_is_connected(dssdev)) return 0;
   in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
   if (IS_ERR(in)) {
     dev_err(dssdev->dev, "failed to find video source\n");
     return PTR_ERR(in);
   }
-  r = in->ops->connect(in, dssdev);
+  r = omapdss_device_connect(in, dssdev);
   if (r) {
     omap_dss_put_device(in);
     return r;
   }
   ddata->in = in;
   return 0;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@

-       in->ops->connect
+       omapdss_device_connect
		(in, dssdev)
--- initial
+++ final
@@ -1,8 +1,8 @@
 static void panel_dpi_disconnect(struct omap_dss_device *dssdev) {
   struct panel_drv_data *ddata = to_panel_data(dssdev);
   struct omap_dss_device *in = ddata->in;
   if (!omapdss_device_is_connected(dssdev)) return;
-  in->ops->disconnect(in, dssdev);
+  omapdss_device_disconnect(in, dssdev);
   omap_dss_put_device(in);
   ddata->in = NULL;
 }<sep>@@
struct omap_dss_device *in;
expression dssdev;
@@
-       in->ops->disconnect
+       omapdss_device_disconnect
		(in, dssdev)