diff options
| -rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index e55e411054d7..1a17dd1447dc 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c | |||
| @@ -977,7 +977,7 @@ static struct omap_dss_device *rfbi_find_dssdev(struct platform_device *pdev) | |||
| 977 | return def_dssdev; | 977 | return def_dssdev; |
| 978 | } | 978 | } |
| 979 | 979 | ||
| 980 | static void rfbi_probe_pdata(struct platform_device *rfbidev) | 980 | static int rfbi_probe_pdata(struct platform_device *rfbidev) |
| 981 | { | 981 | { |
| 982 | struct omap_dss_device *plat_dssdev; | 982 | struct omap_dss_device *plat_dssdev; |
| 983 | struct omap_dss_device *dssdev; | 983 | struct omap_dss_device *dssdev; |
| @@ -986,11 +986,11 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) | |||
| 986 | plat_dssdev = rfbi_find_dssdev(rfbidev); | 986 | plat_dssdev = rfbi_find_dssdev(rfbidev); |
| 987 | 987 | ||
| 988 | if (!plat_dssdev) | 988 | if (!plat_dssdev) |
| 989 | return; | 989 | return 0; |
| 990 | 990 | ||
| 991 | dssdev = dss_alloc_and_init_device(&rfbidev->dev); | 991 | dssdev = dss_alloc_and_init_device(&rfbidev->dev); |
| 992 | if (!dssdev) | 992 | if (!dssdev) |
| 993 | return; | 993 | return -ENOMEM; |
| 994 | 994 | ||
| 995 | dss_copy_device_pdata(dssdev, plat_dssdev); | 995 | dss_copy_device_pdata(dssdev, plat_dssdev); |
| 996 | 996 | ||
| @@ -998,7 +998,7 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) | |||
| 998 | if (r) { | 998 | if (r) { |
| 999 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 999 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
| 1000 | dss_put_device(dssdev); | 1000 | dss_put_device(dssdev); |
| 1001 | return; | 1001 | return r; |
| 1002 | } | 1002 | } |
| 1003 | 1003 | ||
| 1004 | r = omapdss_output_set_device(&rfbi.output, dssdev); | 1004 | r = omapdss_output_set_device(&rfbi.output, dssdev); |
| @@ -1006,7 +1006,7 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) | |||
| 1006 | DSSERR("failed to connect output to new device: %s\n", | 1006 | DSSERR("failed to connect output to new device: %s\n", |
| 1007 | dssdev->name); | 1007 | dssdev->name); |
| 1008 | dss_put_device(dssdev); | 1008 | dss_put_device(dssdev); |
| 1009 | return; | 1009 | return r; |
| 1010 | } | 1010 | } |
| 1011 | 1011 | ||
| 1012 | r = dss_add_device(dssdev); | 1012 | r = dss_add_device(dssdev); |
| @@ -1014,8 +1014,10 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) | |||
| 1014 | DSSERR("device %s register failed: %d\n", dssdev->name, r); | 1014 | DSSERR("device %s register failed: %d\n", dssdev->name, r); |
| 1015 | omapdss_output_unset_device(&rfbi.output); | 1015 | omapdss_output_unset_device(&rfbi.output); |
| 1016 | dss_put_device(dssdev); | 1016 | dss_put_device(dssdev); |
| 1017 | return; | 1017 | return r; |
| 1018 | } | 1018 | } |
| 1019 | |||
| 1020 | return 0; | ||
| 1019 | } | 1021 | } |
| 1020 | 1022 | ||
| 1021 | static void rfbi_init_output(struct platform_device *pdev) | 1023 | static void rfbi_init_output(struct platform_device *pdev) |
| @@ -1091,7 +1093,12 @@ static int omap_rfbihw_probe(struct platform_device *pdev) | |||
| 1091 | 1093 | ||
| 1092 | rfbi_init_output(pdev); | 1094 | rfbi_init_output(pdev); |
| 1093 | 1095 | ||
| 1094 | rfbi_probe_pdata(pdev); | 1096 | r = rfbi_probe_pdata(pdev); |
| 1097 | if (r) { | ||
| 1098 | rfbi_uninit_output(pdev); | ||
| 1099 | pm_runtime_disable(&pdev->dev); | ||
| 1100 | return r; | ||
| 1101 | } | ||
| 1095 | 1102 | ||
| 1096 | return 0; | 1103 | return 0; |
| 1097 | 1104 | ||
