diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-26 07:52:23 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-05-02 05:25:22 -0400 |
commit | c0980297ff8f8184778258a7f544525e483fbd85 (patch) | |
tree | ed16802bd0b3efa6ea58dfe431dcfc2ff07ead43 /drivers/video | |
parent | f60a32fd9e3461dc33d44cca74db18fa09a0fa47 (diff) |
OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata
Add proper error handling for hdmi_probe_pdata(). This will cause
EPROBE_DEFER to be properly passed upwards, causing the HDMI 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/hdmi.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 9aefe60800f2..17f4d55c621c 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -982,7 +982,7 @@ static struct omap_dss_device *hdmi_find_dssdev(struct platform_device *pdev) | |||
982 | return def_dssdev; | 982 | return def_dssdev; |
983 | } | 983 | } |
984 | 984 | ||
985 | static void hdmi_probe_pdata(struct platform_device *pdev) | 985 | static int hdmi_probe_pdata(struct platform_device *pdev) |
986 | { | 986 | { |
987 | struct omap_dss_device *plat_dssdev; | 987 | struct omap_dss_device *plat_dssdev; |
988 | struct omap_dss_device *dssdev; | 988 | struct omap_dss_device *dssdev; |
@@ -992,11 +992,11 @@ static void hdmi_probe_pdata(struct platform_device *pdev) | |||
992 | plat_dssdev = hdmi_find_dssdev(pdev); | 992 | plat_dssdev = hdmi_find_dssdev(pdev); |
993 | 993 | ||
994 | if (!plat_dssdev) | 994 | if (!plat_dssdev) |
995 | return; | 995 | return 0; |
996 | 996 | ||
997 | dssdev = dss_alloc_and_init_device(&pdev->dev); | 997 | dssdev = dss_alloc_and_init_device(&pdev->dev); |
998 | if (!dssdev) | 998 | if (!dssdev) |
999 | return; | 999 | return -ENOMEM; |
1000 | 1000 | ||
1001 | dss_copy_device_pdata(dssdev, plat_dssdev); | 1001 | dss_copy_device_pdata(dssdev, plat_dssdev); |
1002 | 1002 | ||
@@ -1010,7 +1010,7 @@ static void hdmi_probe_pdata(struct platform_device *pdev) | |||
1010 | if (r) { | 1010 | if (r) { |
1011 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 1011 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
1012 | dss_put_device(dssdev); | 1012 | dss_put_device(dssdev); |
1013 | return; | 1013 | return r; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | r = omapdss_output_set_device(&hdmi.output, dssdev); | 1016 | r = omapdss_output_set_device(&hdmi.output, dssdev); |
@@ -1018,7 +1018,7 @@ static void hdmi_probe_pdata(struct platform_device *pdev) | |||
1018 | DSSERR("failed to connect output to new device: %s\n", | 1018 | DSSERR("failed to connect output to new device: %s\n", |
1019 | dssdev->name); | 1019 | dssdev->name); |
1020 | dss_put_device(dssdev); | 1020 | dss_put_device(dssdev); |
1021 | return; | 1021 | return r; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | r = dss_add_device(dssdev); | 1024 | r = dss_add_device(dssdev); |
@@ -1027,8 +1027,10 @@ static void hdmi_probe_pdata(struct platform_device *pdev) | |||
1027 | omapdss_output_unset_device(&hdmi.output); | 1027 | omapdss_output_unset_device(&hdmi.output); |
1028 | hdmi_uninit_display(dssdev); | 1028 | hdmi_uninit_display(dssdev); |
1029 | dss_put_device(dssdev); | 1029 | dss_put_device(dssdev); |
1030 | return; | 1030 | return r; |
1031 | } | 1031 | } |
1032 | |||
1033 | return 0; | ||
1032 | } | 1034 | } |
1033 | 1035 | ||
1034 | static void hdmi_init_output(struct platform_device *pdev) | 1036 | static void hdmi_init_output(struct platform_device *pdev) |
@@ -1096,7 +1098,13 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) | |||
1096 | 1098 | ||
1097 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); | 1099 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); |
1098 | 1100 | ||
1099 | hdmi_probe_pdata(pdev); | 1101 | r = hdmi_probe_pdata(pdev); |
1102 | if (r) { | ||
1103 | hdmi_panel_exit(); | ||
1104 | hdmi_uninit_output(pdev); | ||
1105 | pm_runtime_disable(&pdev->dev); | ||
1106 | return r; | ||
1107 | } | ||
1100 | 1108 | ||
1101 | return 0; | 1109 | return 0; |
1102 | } | 1110 | } |