diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-26 06:47:41 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-05-02 05:24:56 -0400 |
commit | d1890a680e439e1b284faca6e8eaa330c599f99f (patch) | |
tree | 74b4051eb58ee43197e24671361727b37f20ef66 /drivers/video | |
parent | e1086278e9ab7c75edb6a9c0cdbdc452be25eb8d (diff) |
OMAPDSS: DSI: Add error handling for dsi_probe_pdata
Add proper error handling for dsi_probe_pdata(). This will cause
EPROBE_DEFER to be properly passed upwards, causing the DSI 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/dsi.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 55fc0d48b5ed..a73dedc33101 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -5398,7 +5398,7 @@ static struct omap_dss_device *dsi_find_dssdev(struct platform_device *pdev) | |||
5398 | return def_dssdev; | 5398 | return def_dssdev; |
5399 | } | 5399 | } |
5400 | 5400 | ||
5401 | static void dsi_probe_pdata(struct platform_device *dsidev) | 5401 | static int dsi_probe_pdata(struct platform_device *dsidev) |
5402 | { | 5402 | { |
5403 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 5403 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
5404 | struct omap_dss_device *plat_dssdev; | 5404 | struct omap_dss_device *plat_dssdev; |
@@ -5408,11 +5408,11 @@ static void dsi_probe_pdata(struct platform_device *dsidev) | |||
5408 | plat_dssdev = dsi_find_dssdev(dsidev); | 5408 | plat_dssdev = dsi_find_dssdev(dsidev); |
5409 | 5409 | ||
5410 | if (!plat_dssdev) | 5410 | if (!plat_dssdev) |
5411 | return; | 5411 | return 0; |
5412 | 5412 | ||
5413 | dssdev = dss_alloc_and_init_device(&dsidev->dev); | 5413 | dssdev = dss_alloc_and_init_device(&dsidev->dev); |
5414 | if (!dssdev) | 5414 | if (!dssdev) |
5415 | return; | 5415 | return -ENOMEM; |
5416 | 5416 | ||
5417 | dss_copy_device_pdata(dssdev, plat_dssdev); | 5417 | dss_copy_device_pdata(dssdev, plat_dssdev); |
5418 | 5418 | ||
@@ -5420,7 +5420,7 @@ static void dsi_probe_pdata(struct platform_device *dsidev) | |||
5420 | if (r) { | 5420 | if (r) { |
5421 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 5421 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
5422 | dss_put_device(dssdev); | 5422 | dss_put_device(dssdev); |
5423 | return; | 5423 | return r; |
5424 | } | 5424 | } |
5425 | 5425 | ||
5426 | r = omapdss_output_set_device(&dsi->output, dssdev); | 5426 | r = omapdss_output_set_device(&dsi->output, dssdev); |
@@ -5428,7 +5428,7 @@ static void dsi_probe_pdata(struct platform_device *dsidev) | |||
5428 | DSSERR("failed to connect output to new device: %s\n", | 5428 | DSSERR("failed to connect output to new device: %s\n", |
5429 | dssdev->name); | 5429 | dssdev->name); |
5430 | dss_put_device(dssdev); | 5430 | dss_put_device(dssdev); |
5431 | return; | 5431 | return r; |
5432 | } | 5432 | } |
5433 | 5433 | ||
5434 | r = dss_add_device(dssdev); | 5434 | r = dss_add_device(dssdev); |
@@ -5458,7 +5458,7 @@ static void dsi_init_output(struct platform_device *dsidev) | |||
5458 | dss_register_output(out); | 5458 | dss_register_output(out); |
5459 | } | 5459 | } |
5460 | 5460 | ||
5461 | static void __exit dsi_uninit_output(struct platform_device *dsidev) | 5461 | static void dsi_uninit_output(struct platform_device *dsidev) |
5462 | { | 5462 | { |
5463 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 5463 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
5464 | struct omap_dss_output *out = &dsi->output; | 5464 | struct omap_dss_output *out = &dsi->output; |
@@ -5563,7 +5563,13 @@ static int omap_dsihw_probe(struct platform_device *dsidev) | |||
5563 | 5563 | ||
5564 | dsi_init_output(dsidev); | 5564 | dsi_init_output(dsidev); |
5565 | 5565 | ||
5566 | dsi_probe_pdata(dsidev); | 5566 | r = dsi_probe_pdata(dsidev); |
5567 | if (r) { | ||
5568 | dsi_runtime_put(dsidev); | ||
5569 | dsi_uninit_output(dsidev); | ||
5570 | pm_runtime_disable(&dsidev->dev); | ||
5571 | return r; | ||
5572 | } | ||
5567 | 5573 | ||
5568 | dsi_runtime_put(dsidev); | 5574 | dsi_runtime_put(dsidev); |
5569 | 5575 | ||