aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-02 05:19:54 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-02 05:25:23 -0400
commit6aa66f5c01f1f0063b14bd529b24723fb8e58075 (patch)
tree8752848085ebcb729dc0ad15238271a8ac60c0d4 /drivers/video
parentc0980297ff8f8184778258a7f544525e483fbd85 (diff)
OMAPDSS: VENC: Add error handling for venc_probe_pdata
Add proper error handling for venc_probe_pdata(). This will cause EPROBE_DEFER to be properly passed upwards, causing the VENC 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/venc.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 62ba53b2e574..74fdb3ee209e 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -754,7 +754,7 @@ static struct omap_dss_device *venc_find_dssdev(struct platform_device *pdev)
754 return def_dssdev; 754 return def_dssdev;
755} 755}
756 756
757static void venc_probe_pdata(struct platform_device *vencdev) 757static int venc_probe_pdata(struct platform_device *vencdev)
758{ 758{
759 struct omap_dss_device *plat_dssdev; 759 struct omap_dss_device *plat_dssdev;
760 struct omap_dss_device *dssdev; 760 struct omap_dss_device *dssdev;
@@ -763,11 +763,11 @@ static void venc_probe_pdata(struct platform_device *vencdev)
763 plat_dssdev = venc_find_dssdev(vencdev); 763 plat_dssdev = venc_find_dssdev(vencdev);
764 764
765 if (!plat_dssdev) 765 if (!plat_dssdev)
766 return; 766 return 0;
767 767
768 dssdev = dss_alloc_and_init_device(&vencdev->dev); 768 dssdev = dss_alloc_and_init_device(&vencdev->dev);
769 if (!dssdev) 769 if (!dssdev)
770 return; 770 return -ENOMEM;
771 771
772 dss_copy_device_pdata(dssdev, plat_dssdev); 772 dss_copy_device_pdata(dssdev, plat_dssdev);
773 773
@@ -775,7 +775,7 @@ static void venc_probe_pdata(struct platform_device *vencdev)
775 if (r) { 775 if (r) {
776 DSSERR("device %s init failed: %d\n", dssdev->name, r); 776 DSSERR("device %s init failed: %d\n", dssdev->name, r);
777 dss_put_device(dssdev); 777 dss_put_device(dssdev);
778 return; 778 return r;
779 } 779 }
780 780
781 r = omapdss_output_set_device(&venc.output, dssdev); 781 r = omapdss_output_set_device(&venc.output, dssdev);
@@ -783,7 +783,7 @@ static void venc_probe_pdata(struct platform_device *vencdev)
783 DSSERR("failed to connect output to new device: %s\n", 783 DSSERR("failed to connect output to new device: %s\n",
784 dssdev->name); 784 dssdev->name);
785 dss_put_device(dssdev); 785 dss_put_device(dssdev);
786 return; 786 return r;
787 } 787 }
788 788
789 r = dss_add_device(dssdev); 789 r = dss_add_device(dssdev);
@@ -791,8 +791,10 @@ static void venc_probe_pdata(struct platform_device *vencdev)
791 DSSERR("device %s register failed: %d\n", dssdev->name, r); 791 DSSERR("device %s register failed: %d\n", dssdev->name, r);
792 omapdss_output_unset_device(&venc.output); 792 omapdss_output_unset_device(&venc.output);
793 dss_put_device(dssdev); 793 dss_put_device(dssdev);
794 return; 794 return r;
795 } 795 }
796
797 return 0;
796} 798}
797 799
798static void venc_init_output(struct platform_device *pdev) 800static void venc_init_output(struct platform_device *pdev)
@@ -864,7 +866,13 @@ static int omap_venchw_probe(struct platform_device *pdev)
864 866
865 venc_init_output(pdev); 867 venc_init_output(pdev);
866 868
867 venc_probe_pdata(pdev); 869 r = venc_probe_pdata(pdev);
870 if (r) {
871 venc_panel_exit();
872 venc_uninit_output(pdev);
873 pm_runtime_disable(&pdev->dev);
874 return r;
875 }
868 876
869 return 0; 877 return 0;
870 878