aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-26 07:33:05 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-02 05:24:20 -0400
commitbcb734d2a1ef1b40fd7600b0f4f9225484572c67 (patch)
treeb145e5036ba50cf4b531d3d7d917074b46c47e8d /drivers/video
parentb5a99c2626a4ace340a535775342e2a75fbe60e7 (diff)
OMAPDSS: DPI: Add error handling for dpi_probe_pdata
Add proper error handling for dpi_probe_pdata(). This will cause EPROBE_DEFER to be properly passed upwards, causing the DPI driver to be probed again later if a resource was missing. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dpi.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 202478795c1b..757b57f7275a 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -635,7 +635,7 @@ static struct omap_dss_device *dpi_find_dssdev(struct platform_device *pdev)
635 return def_dssdev; 635 return def_dssdev;
636} 636}
637 637
638static void dpi_probe_pdata(struct platform_device *dpidev) 638static int dpi_probe_pdata(struct platform_device *dpidev)
639{ 639{
640 struct omap_dss_device *plat_dssdev; 640 struct omap_dss_device *plat_dssdev;
641 struct omap_dss_device *dssdev; 641 struct omap_dss_device *dssdev;
@@ -644,11 +644,11 @@ static void dpi_probe_pdata(struct platform_device *dpidev)
644 plat_dssdev = dpi_find_dssdev(dpidev); 644 plat_dssdev = dpi_find_dssdev(dpidev);
645 645
646 if (!plat_dssdev) 646 if (!plat_dssdev)
647 return; 647 return 0;
648 648
649 dssdev = dss_alloc_and_init_device(&dpidev->dev); 649 dssdev = dss_alloc_and_init_device(&dpidev->dev);
650 if (!dssdev) 650 if (!dssdev)
651 return; 651 return -ENOMEM;
652 652
653 dss_copy_device_pdata(dssdev, plat_dssdev); 653 dss_copy_device_pdata(dssdev, plat_dssdev);
654 654
@@ -656,7 +656,7 @@ static void dpi_probe_pdata(struct platform_device *dpidev)
656 if (r) { 656 if (r) {
657 DSSERR("device %s init failed: %d\n", dssdev->name, r); 657 DSSERR("device %s init failed: %d\n", dssdev->name, r);
658 dss_put_device(dssdev); 658 dss_put_device(dssdev);
659 return; 659 return r;
660 } 660 }
661 661
662 r = omapdss_output_set_device(&dpi.output, dssdev); 662 r = omapdss_output_set_device(&dpi.output, dssdev);
@@ -664,7 +664,7 @@ static void dpi_probe_pdata(struct platform_device *dpidev)
664 DSSERR("failed to connect output to new device: %s\n", 664 DSSERR("failed to connect output to new device: %s\n",
665 dssdev->name); 665 dssdev->name);
666 dss_put_device(dssdev); 666 dss_put_device(dssdev);
667 return; 667 return r;
668 } 668 }
669 669
670 r = dss_add_device(dssdev); 670 r = dss_add_device(dssdev);
@@ -672,8 +672,10 @@ static void dpi_probe_pdata(struct platform_device *dpidev)
672 DSSERR("device %s register failed: %d\n", dssdev->name, r); 672 DSSERR("device %s register failed: %d\n", dssdev->name, r);
673 omapdss_output_unset_device(&dpi.output); 673 omapdss_output_unset_device(&dpi.output);
674 dss_put_device(dssdev); 674 dss_put_device(dssdev);
675 return; 675 return r;
676 } 676 }
677
678 return 0;
677} 679}
678 680
679static void dpi_init_output(struct platform_device *pdev) 681static void dpi_init_output(struct platform_device *pdev)
@@ -698,11 +700,17 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
698 700
699static int omap_dpi_probe(struct platform_device *pdev) 701static int omap_dpi_probe(struct platform_device *pdev)
700{ 702{
703 int r;
704
701 mutex_init(&dpi.lock); 705 mutex_init(&dpi.lock);
702 706
703 dpi_init_output(pdev); 707 dpi_init_output(pdev);
704 708
705 dpi_probe_pdata(pdev); 709 r = dpi_probe_pdata(pdev);
710 if (r) {
711 dpi_uninit_output(pdev);
712 return r;
713 }
706 714
707 return 0; 715 return 0;
708} 716}