From patchwork Thu Nov 15 15:58:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1750661 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DAB473FC8A for ; Thu, 15 Nov 2012 16:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768326Ab2KOQAH (ORCPT ); Thu, 15 Nov 2012 11:00:07 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:56292 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768316Ab2KOQAE (ORCPT ); Thu, 15 Nov 2012 11:00:04 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id qAFG04oE021261; Thu, 15 Nov 2012 10:00:04 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAFG045A030673; Thu, 15 Nov 2012 10:00:04 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Thu, 15 Nov 2012 10:00:04 -0600 Received: from deskari.tieu.ti.com (h68-10.vpn.ti.com [172.24.68.10]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAFFx6vT025421; Thu, 15 Nov 2012 10:00:02 -0600 From: Tomi Valkeinen To: Archit Taneja , Rob Clark CC: , , Tomi Valkeinen Subject: [PATCH 32/32] OMAPDSS: use omapdss_compat_init() in other drivers Date: Thu, 15 Nov 2012 17:58:40 +0200 Message-ID: <1352995120-3288-33-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1352995120-3288-1-git-send-email-tomi.valkeinen@ti.com> References: <1352995120-3288-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org omapdss_compat_init() and omapdss_compat_uninit() is called internally by omapdss. This patch moves the calls to omapfb, omap_vout and omapdrm drivers. omapdrm driver can later remove the call after non-compat support has been implemented in omapdrm. Signed-off-by: Tomi Valkeinen --- drivers/media/platform/omap/omap_vout.c | 17 ++++++++++++++--- drivers/staging/omapdrm/omap_drv.c | 11 +++++++++++ drivers/video/omap2/dss/core.c | 4 ---- drivers/video/omap2/omapfb/omapfb-main.c | 6 ++++++ 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 3ff94a3..32c596f 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c @@ -2186,14 +2186,23 @@ static int __init omap_vout_probe(struct platform_device *pdev) struct omap_dss_device *def_display; struct omap2video_device *vid_dev = NULL; + ret = omapdss_compat_init(); + if (ret) { + dev_err(&pdev->dev, "failed to init dss\n"); + return ret; + } + if (pdev->num_resources == 0) { dev_err(&pdev->dev, "probed for an unknown device\n"); - return -ENODEV; + ret = -ENODEV; + goto err_dss_init; } vid_dev = kzalloc(sizeof(struct omap2video_device), GFP_KERNEL); - if (vid_dev == NULL) - return -ENOMEM; + if (vid_dev == NULL) { + ret = -ENOMEM; + goto err_dss_init; + } vid_dev->num_displays = 0; for_each_dss_dev(dssdev) { @@ -2288,6 +2297,8 @@ probe_err1: } probe_err0: kfree(vid_dev); +err_dss_init: + omapdss_compat_uninit(); return ret; } diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c index ebdb0b6..2bf7259 100644 --- a/drivers/staging/omapdrm/omap_drv.c +++ b/drivers/staging/omapdrm/omap_drv.c @@ -572,6 +572,14 @@ static int dev_load(struct drm_device *dev, unsigned long flags) dev->dev_private = priv; + ret = omapdss_compat_init(); + if (ret) { + dev_err(dev->dev, "coult not init omapdss\n"); + dev->dev_private = NULL; + kfree(priv); + return ret; + } + priv->wq = alloc_ordered_workqueue("omapdrm", 0); INIT_LIST_HEAD(&priv->obj_list); @@ -583,6 +591,7 @@ static int dev_load(struct drm_device *dev, unsigned long flags) dev_err(dev->dev, "omap_modeset_init failed: ret=%d\n", ret); dev->dev_private = NULL; kfree(priv); + omapdss_compat_uninit(); return ret; } @@ -618,6 +627,8 @@ static int dev_unload(struct drm_device *dev) flush_workqueue(priv->wq); destroy_workqueue(priv->wq); + omapdss_compat_uninit(); + kfree(dev->dev_private); dev->dev_private = NULL; diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index cf2c619..3d33426 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -247,8 +247,6 @@ static int __init omap_dss_probe(struct platform_device *pdev) dss_features_init(omapdss_get_version()); - omapdss_compat_init(); - r = dss_initialize_debugfs(); if (r) goto err_debugfs; @@ -273,8 +271,6 @@ static int omap_dss_remove(struct platform_device *pdev) dss_uninitialize_debugfs(); - omapdss_compat_uninit(); - return 0; } diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index be9096c..898470a 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -2436,6 +2436,9 @@ static int __init omapfb_probe(struct platform_device *pdev) "ignoring the module parameter vrfb=y\n"); } + r = omapdss_compat_init(); + if (r) + goto err0; mutex_init(&fbdev->mtx); @@ -2559,6 +2562,7 @@ static int __init omapfb_probe(struct platform_device *pdev) cleanup: omapfb_free_resources(fbdev); + omapdss_compat_uninit(); err0: dev_err(&pdev->dev, "failed to setup omapfb\n"); return r; @@ -2574,6 +2578,8 @@ static int __exit omapfb_remove(struct platform_device *pdev) omapfb_free_resources(fbdev); + omapdss_compat_uninit(); + return 0; }