From patchwork Thu Feb 8 10:21:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 127664 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1444530ljc; Thu, 8 Feb 2018 04:38:18 -0800 (PST) X-Google-Smtp-Source: AH8x224mrzCeEdigatGj6HMNgP9md3cIxCZr9C+iWUA0S7Mg06oeUrmydmZxZVRZS5yJ6mfYwNDc X-Received: by 10.98.9.67 with SMTP id e64mr572049pfd.230.1518093498584; Thu, 08 Feb 2018 04:38:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518093498; cv=none; d=google.com; s=arc-20160816; b=J2qYqy9NiNuXrvAuFfQU22BGYJSJqkz19pDnPpHuk+MfyTzsrKMSuo/AzahHkQoevF +AOcZVLUGLA9fKfGkGWVUzNqfohDnSCOV3IZ0x7JDcJ4/n7B5OT4ZAgLYXUvPIKb+j2p X++d+VcuFhSrUMxopeoIR7TXLnnL4J8n8NZdTyZtdySK0S7YeFK12eDCXmWTBg8WgDvh +kkk5Vcp2Hd7zOP/eBMaoGMIcC62aJ8Ne4Hz4JS0Qd4PqZGDCvY/bBEt6GLPhD3KeJur VZAumvqw3+0TFJ5rivKNdkN19iEwKHCTXf8V/N1CiSy64+j8/5hnXWabbiAbfenEXD3/ AE9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=UczPLYdIMV+tT98AVuSbfdqiWDilmkoJ7I2yRf9trI4=; b=zLReSPBdZGWU2ChPwR2e48N+bqmvt56/1XDR5q9hJGCg3QupUZy0lG+HQtQcLjXymt RcQs2HOnWBiU4TEuXC/Ec75q63wTwYl9tKiiZoRWKwsiTGhVPmDPzTLewJzbh13tGETO vY2T7dcj7RLuE1rUwlx+O5q/tuCjyBSmclhmDXw9pae+j+Bltb5zGwUPCyvjOFfHuU4k 4H88dbScpYHrETyGkBMxFyAnfeHO588P+rNgRDhsAa8InobdRIwJ+2ZhoNlaGpabjiGs WX78rLtGQ0JMruWxBlq4MffrNo5OWPOq23cuJUHF+z2FKpi11SbeTme+vyPOIBbg95mw wkYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=pWe3F3Ww; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id i5-v6si1500330plr.335.2018.02.08.04.38.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2018 04:38:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=pWe3F3Ww; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C8F26E605; Thu, 8 Feb 2018 12:37:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 452B86E605 for ; Thu, 8 Feb 2018 12:37:45 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w18ALIml011017; Thu, 8 Feb 2018 04:21:18 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518085278; bh=CxFPzyothIvAw/Z2DeKxzp2s5DATZ5erSBU32RAQJsc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=pWe3F3WwAEDRV8uumasNNeNHCVNeJBuXLmaq0wnfsboj9cHFFGslTngMlrB9NsAyb 364bam+3tltxeLs9WvNZbd5/3Lw38PO7ZZT0LR6WS7ky6kM7lZ5M3pUsmX1fm16kpg JklfOrZDZLS5zK3ViFw7QcrpmkP9qc6gzJhtnq0Y= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w18ALIEJ002962; Thu, 8 Feb 2018 04:21:18 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 8 Feb 2018 04:21:17 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 8 Feb 2018 04:21:17 -0600 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w18AL9C1012092; Thu, 8 Feb 2018 04:21:16 -0600 From: Jyri Sarha To: Subject: [PATCH v4 5/6] drm/omap: dss: Move platform_device_register from core.c to dss.c probe Date: Thu, 8 Feb 2018 12:21:05 +0200 Message-ID: <60fa139e76020d244f0a4d5bd9807201a91d1f85.1518084092.git.jsarha@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com, Jyri Sarha Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Register the omapdrm device when we know that dss device probe going to succeed. This avoids DSS6 and DSS2 omapdrm device registration from colliding with each other. Signed-off-by: Jyri Sarha --- drivers/gpu/drm/omapdrm/dss/core.c | 26 ++------------------------ drivers/gpu/drm/omapdrm/dss/dss.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c index acef7ec..6c9f667 100644 --- a/drivers/gpu/drm/omapdrm/dss/core.c +++ b/drivers/gpu/drm/omapdrm/dss/core.c @@ -45,36 +45,14 @@ #endif }; -static struct platform_device *omap_drm_device; - static int __init omap_dss_init(void) { - int r; - - r = platform_register_drivers(omap_dss_drivers, - ARRAY_SIZE(omap_dss_drivers)); - if (r) - goto err_reg; - - omap_drm_device = platform_device_register_simple("omapdrm", 0, NULL, 0); - if (IS_ERR(omap_drm_device)) { - r = PTR_ERR(omap_drm_device); - goto err_reg; - } - - return 0; - -err_reg: - platform_unregister_drivers(omap_dss_drivers, - ARRAY_SIZE(omap_dss_drivers)); - - return r; + return platform_register_drivers(omap_dss_drivers, + ARRAY_SIZE(omap_dss_drivers)); } static void __exit omap_dss_exit(void) { - platform_device_unregister(omap_drm_device); - platform_unregister_drivers(omap_dss_drivers, ARRAY_SIZE(omap_dss_drivers)); } diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 04300b2..3cfe4a7 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1298,6 +1298,17 @@ static int dss_video_pll_probe(struct platform_device *pdev) { /* sentinel */ } }; +static struct platform_device *omap_drm_device = NULL; + +static int initialize_omapdrm_device(void) +{ + omap_drm_device = platform_device_register_simple("omapdrm", 0, NULL, 0); + if (IS_ERR(omap_drm_device)) + return PTR_ERR(omap_drm_device); + + return 0; +} + static int dss_bind(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -1359,6 +1370,10 @@ static int dss_bind(struct device *dev) if (r) goto err_component; + r = initialize_omapdrm_device(); + if (r) + goto err_omapdrm_device; + dss_debugfs_create_file("dss", dss_dump_regs); pm_set_vt_switch(0); @@ -1368,6 +1383,8 @@ static int dss_bind(struct device *dev) return 0; +err_omapdrm_device: + component_unbind_all(&pdev->dev, NULL); err_component: err_runtime_get: pm_runtime_disable(&pdev->dev); @@ -1390,6 +1407,8 @@ static void dss_unbind(struct device *dev) omapdss_set_is_initialized(false); + platform_device_unregister(omap_drm_device); + component_unbind_all(&pdev->dev, NULL); if (dss.video1_pll)