diff options
| author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-05-02 05:10:37 -0400 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-05-02 05:24:21 -0400 |
| commit | e1086278e9ab7c75edb6a9c0cdbdc452be25eb8d (patch) | |
| tree | ccfe84c79fde9c464ec2ab7ea043f738ea740832 | |
| parent | bcb734d2a1ef1b40fd7600b0f4f9225484572c67 (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>
| -rw-r--r-- | drivers/video/omap2/dss/sdi.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index af7d6aefe423..0bcd30272f69 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) | |||
| 296 | return def_dssdev; | 296 | return def_dssdev; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | static void sdi_probe_pdata(struct platform_device *sdidev) | 299 | static int sdi_probe_pdata(struct platform_device *sdidev) |
| 300 | { | 300 | { |
| 301 | struct omap_dss_device *plat_dssdev; | 301 | struct omap_dss_device *plat_dssdev; |
| 302 | struct omap_dss_device *dssdev; | 302 | struct omap_dss_device *dssdev; |
| @@ -305,11 +305,11 @@ static void sdi_probe_pdata(struct platform_device *sdidev) | |||
| 305 | plat_dssdev = sdi_find_dssdev(sdidev); | 305 | plat_dssdev = sdi_find_dssdev(sdidev); |
| 306 | 306 | ||
| 307 | if (!plat_dssdev) | 307 | if (!plat_dssdev) |
| 308 | return; | 308 | return 0; |
| 309 | 309 | ||
| 310 | dssdev = dss_alloc_and_init_device(&sdidev->dev); | 310 | dssdev = dss_alloc_and_init_device(&sdidev->dev); |
| 311 | if (!dssdev) | 311 | if (!dssdev) |
| 312 | return; | 312 | return -ENOMEM; |
| 313 | 313 | ||
| 314 | dss_copy_device_pdata(dssdev, plat_dssdev); | 314 | dss_copy_device_pdata(dssdev, plat_dssdev); |
| 315 | 315 | ||
| @@ -317,7 +317,7 @@ static void sdi_probe_pdata(struct platform_device *sdidev) | |||
| 317 | if (r) { | 317 | if (r) { |
| 318 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 318 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
| 319 | dss_put_device(dssdev); | 319 | dss_put_device(dssdev); |
| 320 | return; | 320 | return r; |
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | r = omapdss_output_set_device(&sdi.output, dssdev); | 323 | r = omapdss_output_set_device(&sdi.output, dssdev); |
| @@ -325,7 +325,7 @@ static void sdi_probe_pdata(struct platform_device *sdidev) | |||
| 325 | DSSERR("failed to connect output to new device: %s\n", | 325 | DSSERR("failed to connect output to new device: %s\n", |
| 326 | dssdev->name); | 326 | dssdev->name); |
| 327 | dss_put_device(dssdev); | 327 | dss_put_device(dssdev); |
| 328 | return; | 328 | return r; |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | r = dss_add_device(dssdev); | 331 | r = dss_add_device(dssdev); |
| @@ -333,8 +333,10 @@ static void sdi_probe_pdata(struct platform_device *sdidev) | |||
| 333 | DSSERR("device %s register failed: %d\n", dssdev->name, r); | 333 | DSSERR("device %s register failed: %d\n", dssdev->name, r); |
| 334 | omapdss_output_unset_device(&sdi.output); | 334 | omapdss_output_unset_device(&sdi.output); |
| 335 | dss_put_device(dssdev); | 335 | dss_put_device(dssdev); |
| 336 | return; | 336 | return r; |
| 337 | } | 337 | } |
| 338 | |||
| 339 | return 0; | ||
| 338 | } | 340 | } |
| 339 | 341 | ||
| 340 | static void sdi_init_output(struct platform_device *pdev) | 342 | static void sdi_init_output(struct platform_device *pdev) |
| @@ -359,9 +361,15 @@ static void __exit sdi_uninit_output(struct platform_device *pdev) | |||
| 359 | 361 | ||
| 360 | static int omap_sdi_probe(struct platform_device *pdev) | 362 | static int omap_sdi_probe(struct platform_device *pdev) |
| 361 | { | 363 | { |
| 364 | int r; | ||
| 365 | |||
| 362 | sdi_init_output(pdev); | 366 | sdi_init_output(pdev); |
| 363 | 367 | ||
| 364 | sdi_probe_pdata(pdev); | 368 | r = sdi_probe_pdata(pdev); |
| 369 | if (r) { | ||
| 370 | sdi_uninit_output(pdev); | ||
| 371 | return r; | ||
| 372 | } | ||
| 365 | 373 | ||
| 366 | return 0; | 374 | return 0; |
| 367 | } | 375 | } |
