aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-02 12:10:37 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-02 12:24:21 +0300
commite1086278e9ab7c75edb6a9c0cdbdc452be25eb8d (patch)
treeccfe84c79fde9c464ec2ab7ea043f738ea740832 /drivers/video
parentbcb734d2a1ef1b40fd7600b0f4f9225484572c67 (diff)
OMAPDSS: SDI: Add error handling for sdi_probe_pdata
Add proper error handling for sdi_probe_pdata(). This will cause EPROBE_DEFER to be properly passed upwards, causing the SDI 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/sdi.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index af7d6aefe42..0bcd30272f6 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -296,7 +296,7 @@ static struct omap_dss_device *sdi_find_dssdev(struct platform_device *pdev)
return def_dssdev;
}
-static void sdi_probe_pdata(struct platform_device *sdidev)
+static int sdi_probe_pdata(struct platform_device *sdidev)
{
struct omap_dss_device *plat_dssdev;
struct omap_dss_device *dssdev;
@@ -305,11 +305,11 @@ static void sdi_probe_pdata(struct platform_device *sdidev)
plat_dssdev = sdi_find_dssdev(sdidev);
if (!plat_dssdev)
- return;
+ return 0;
dssdev = dss_alloc_and_init_device(&sdidev->dev);
if (!dssdev)
- return;
+ return -ENOMEM;
dss_copy_device_pdata(dssdev, plat_dssdev);
@@ -317,7 +317,7 @@ static void sdi_probe_pdata(struct platform_device *sdidev)
if (r) {
DSSERR("device %s init failed: %d\n", dssdev->name, r);
dss_put_device(dssdev);
- return;
+ return r;
}
r = omapdss_output_set_device(&sdi.output, dssdev);
@@ -325,7 +325,7 @@ static void sdi_probe_pdata(struct platform_device *sdidev)
DSSERR("failed to connect output to new device: %s\n",
dssdev->name);
dss_put_device(dssdev);
- return;
+ return r;
}
r = dss_add_device(dssdev);
@@ -333,8 +333,10 @@ static void sdi_probe_pdata(struct platform_device *sdidev)
DSSERR("device %s register failed: %d\n", dssdev->name, r);
omapdss_output_unset_device(&sdi.output);
dss_put_device(dssdev);
- return;
+ return r;
}
+
+ return 0;
}
static void sdi_init_output(struct platform_device *pdev)
@@ -359,9 +361,15 @@ static void __exit sdi_uninit_output(struct platform_device *pdev)
static int omap_sdi_probe(struct platform_device *pdev)
{
+ int r;
+
sdi_init_output(pdev);
- sdi_probe_pdata(pdev);
+ r = sdi_probe_pdata(pdev);
+ if (r) {
+ sdi_uninit_output(pdev);
+ return r;
+ }
return 0;
}