Move creation of the sysfs files for displays to the compat layer.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
int omapdss_compat_init(void)
{
struct platform_device *pdev = dss_get_core_pdev();
+ struct omap_dss_device *dssdev = NULL;
int i, r;
mutex_lock(&compat_init_lock);
if (r)
goto err_mgr_ops;
+ for_each_dss_dev(dssdev) {
+ r = display_init_sysfs(pdev, dssdev);
+ /* XXX uninit sysfs files on error */
+ if (r)
+ goto err_disp_sysfs;
+ }
+
dispc_runtime_get();
r = dss_dispc_initialize_irq();
err_init_irq:
dispc_runtime_put();
+
+err_disp_sysfs:
dss_uninstall_mgr_ops();
err_mgr_ops:
void omapdss_compat_uninit(void)
{
struct platform_device *pdev = dss_get_core_pdev();
+ struct omap_dss_device *dssdev = NULL;
mutex_lock(&compat_init_lock);
dss_dispc_uninitialize_irq();
+ for_each_dss_dev(dssdev)
+ display_uninit_sysfs(pdev, dssdev);
+
dss_uninstall_mgr_ops();
dss_uninit_overlay_managers(pdev);
dev_name(dev), dssdev->driver_name,
dssdrv->driver.name);
- r = dss_init_device(core.pdev, dssdev);
- if (r)
- return r;
-
r = dssdrv->probe(dssdev);
if (r) {
DSSERR("driver probe failed: %d\n", r);
- dss_uninit_device(core.pdev, dssdev);
return r;
}
dssdrv->remove(dssdev);
- dss_uninit_device(core.pdev, dssdev);
-
dssdev->driver = NULL;
return 0;
}
EXPORT_SYMBOL(omapdss_default_get_timings);
-int dss_init_device(struct platform_device *pdev,
- struct omap_dss_device *dssdev)
-{
- int r;
-
- r = display_init_sysfs(pdev, dssdev);
- if (r) {
- omapdss_output_unset_device(dssdev->output);
- return r;
- }
-
- return 0;
-}
-
-void dss_uninit_device(struct platform_device *pdev,
- struct omap_dss_device *dssdev)
-{
- display_uninit_sysfs(pdev, dssdev);
-}
-
static int dss_suspend_device(struct device *dev, void *data)
{
struct omap_dss_device *dssdev = to_dss_device(dev);
int dss_resume_all_devices(void);
void dss_disable_all_devices(void);
-int dss_init_device(struct platform_device *pdev,
- struct omap_dss_device *dssdev);
-void dss_uninit_device(struct platform_device *pdev,
- struct omap_dss_device *dssdev);
-
int display_init_sysfs(struct platform_device *pdev,
struct omap_dss_device *dssdev);
void display_uninit_sysfs(struct platform_device *pdev,