Commit f60a32fd authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: RFBI: Add error handling for rfbi_probe_pdata

Add proper error handling for rfbi_probe_pdata(). This will cause
EPROBE_DEFER to be properly passed upwards, causing the RFBI driver to be
probed again later if a resource was missing.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent d1890a68
...@@ -977,7 +977,7 @@ static struct omap_dss_device *rfbi_find_dssdev(struct platform_device *pdev) ...@@ -977,7 +977,7 @@ static struct omap_dss_device *rfbi_find_dssdev(struct platform_device *pdev)
return def_dssdev; return def_dssdev;
} }
static void rfbi_probe_pdata(struct platform_device *rfbidev) static int rfbi_probe_pdata(struct platform_device *rfbidev)
{ {
struct omap_dss_device *plat_dssdev; struct omap_dss_device *plat_dssdev;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
...@@ -986,11 +986,11 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) ...@@ -986,11 +986,11 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev)
plat_dssdev = rfbi_find_dssdev(rfbidev); plat_dssdev = rfbi_find_dssdev(rfbidev);
if (!plat_dssdev) if (!plat_dssdev)
return; return 0;
dssdev = dss_alloc_and_init_device(&rfbidev->dev); dssdev = dss_alloc_and_init_device(&rfbidev->dev);
if (!dssdev) if (!dssdev)
return; return -ENOMEM;
dss_copy_device_pdata(dssdev, plat_dssdev); dss_copy_device_pdata(dssdev, plat_dssdev);
...@@ -998,7 +998,7 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) ...@@ -998,7 +998,7 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev)
if (r) { if (r) {
DSSERR("device %s init failed: %d\n", dssdev->name, r); DSSERR("device %s init failed: %d\n", dssdev->name, r);
dss_put_device(dssdev); dss_put_device(dssdev);
return; return r;
} }
r = omapdss_output_set_device(&rfbi.output, dssdev); r = omapdss_output_set_device(&rfbi.output, dssdev);
...@@ -1006,7 +1006,7 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) ...@@ -1006,7 +1006,7 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev)
DSSERR("failed to connect output to new device: %s\n", DSSERR("failed to connect output to new device: %s\n",
dssdev->name); dssdev->name);
dss_put_device(dssdev); dss_put_device(dssdev);
return; return r;
} }
r = dss_add_device(dssdev); r = dss_add_device(dssdev);
...@@ -1014,8 +1014,10 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev) ...@@ -1014,8 +1014,10 @@ static void rfbi_probe_pdata(struct platform_device *rfbidev)
DSSERR("device %s register failed: %d\n", dssdev->name, r); DSSERR("device %s register failed: %d\n", dssdev->name, r);
omapdss_output_unset_device(&rfbi.output); omapdss_output_unset_device(&rfbi.output);
dss_put_device(dssdev); dss_put_device(dssdev);
return; return r;
} }
return 0;
} }
static void rfbi_init_output(struct platform_device *pdev) static void rfbi_init_output(struct platform_device *pdev)
...@@ -1091,7 +1093,12 @@ static int omap_rfbihw_probe(struct platform_device *pdev) ...@@ -1091,7 +1093,12 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
rfbi_init_output(pdev); rfbi_init_output(pdev);
rfbi_probe_pdata(pdev); r = rfbi_probe_pdata(pdev);
if (r) {
rfbi_uninit_output(pdev);
pm_runtime_disable(&pdev->dev);
return r;
}
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment