From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54C0EC433EF for ; Thu, 2 Dec 2021 22:28:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8FDBC6FC6F; Thu, 2 Dec 2021 22:27:59 +0000 (UTC) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by gabe.freedesktop.org (Postfix) with ESMTPS id F06176FC55 for ; Thu, 2 Dec 2021 22:27:54 +0000 (UTC) Received: by mail-pl1-x62e.google.com with SMTP id u17so735985plg.9 for ; Thu, 02 Dec 2021 14:27:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3a3i/nDaB8ZUdNqJ4VU8hWXyXTL7/wWiLoMS1h5NiSM=; b=PrhJPHDYUMYrr7Z38k7lHS+R3rg5br5jmDxDI/fMcQW6Tez0tJCj0ZyPDKVcJIpNbR RUQLEn6vaF8L0SiNiQK7mM8wbrTmqB5zFKnAK2fLgIOM9ZMpBEWJHiHZhJOvAfiQNHTV 2GMLWd8BO6z3t4VS0fDKLKtsRcZ/FMb4+7W7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3a3i/nDaB8ZUdNqJ4VU8hWXyXTL7/wWiLoMS1h5NiSM=; b=n67XykeRHom5ckomhvGoRdRwNaEz0GjKwpU1MuUP1EOufIqXuVhukryAfU0ZIgafTM T950kvVuMWL3eVhADnq4mLNWzZn13qlkcvWb96WkgyH2qJr40Q02XgkJusvYeEU6zKYG 3krI3SPPfYRXeBUs3Gm2BqZ6rzep+jj9ygjte2Gb3u1DQ+jCrcJ9mJrRVVeQpfxy0NZc hv5I2Gr2+fRlhQnUYtLWgtlzBFq5kZXQx6AVHwjwjSunDt6hxhsHNrQ51CVDn/LapEQ7 XLlWpjpUHN4+3VJmaVVxmDfBZXl1u/2kjKD3k+phblyZ0R7tdix4K5UiKsUTdEWnWfjG vXrg== X-Gm-Message-State: AOAM530kUndJ/Xrook17Q5ScDe2rAC5Mmh5uQB0hfHhcn3VWCHI0zO7R Cr4ma8km4UWk4RSaQNrTVViYhg== X-Google-Smtp-Source: ABdhPJyp13jsLtrHtY/hYRWS9wVZnJYDqVf8my8aKb8cYOnB+4i/m58C6/m7qRtTBejE+43q8owBmA== X-Received: by 2002:a17:90a:a786:: with SMTP id f6mr9065942pjq.158.1638484074553; Thu, 02 Dec 2021 14:27:54 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:f4f2:1b7e:5aea:bf3c]) by smtp.gmail.com with ESMTPSA id q9sm836934pfj.9.2021.12.02.14.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 14:27:54 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman Subject: [PATCH v4 22/34] drm/sti: Migrate to aggregate driver Date: Thu, 2 Dec 2021 14:27:20 -0800 Message-Id: <20211202222732.2453851-23-swboyd@chromium.org> X-Mailer: git-send-email 2.34.0.384.gca35af8252-goog In-Reply-To: <20211202222732.2453851-1-swboyd@chromium.org> References: <20211202222732.2453851-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Saravana Kannan , "Rafael J. Wysocki" , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Russell King , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use an aggregate driver instead of component ops so that we can get proper driver probe ordering of the aggregate device with respect to all the component devices that make up the aggregate device. Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/sti/sti_drv.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index c7efb43b83ee..b277cc679154 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -182,8 +182,9 @@ static void sti_cleanup(struct drm_device *ddev) ddev->dev_private = NULL; } -static int sti_bind(struct device *dev) +static int sti_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *ddev; int ret; @@ -216,8 +217,9 @@ static int sti_bind(struct device *dev) return ret; } -static void sti_unbind(struct device *dev) +static void sti_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *ddev = dev_get_drvdata(dev); drm_dev_unregister(ddev); @@ -225,9 +227,13 @@ static void sti_unbind(struct device *dev) drm_dev_put(ddev); } -static const struct component_master_ops sti_ops = { - .bind = sti_bind, - .unbind = sti_unbind, +static struct aggregate_driver sti_aggregate_driver = { + .probe = sti_bind, + .remove = sti_unbind, + .driver = { + .name = "sti_drm", + .owner = THIS_MODULE, + }, }; static int sti_platform_probe(struct platform_device *pdev) @@ -249,12 +255,12 @@ static int sti_platform_probe(struct platform_device *pdev) child_np = of_get_next_available_child(node, child_np); } - return component_master_add_with_match(dev, &sti_ops, match); + return component_aggregate_register(dev, &sti_aggregate_driver, match); } static int sti_platform_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &sti_ops); + component_aggregate_unregister(&pdev->dev, &sti_aggregate_driver); return 0; } -- https://chromeos.dev