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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FBDFC433F5 for ; Wed, 6 Oct 2021 19:39:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE6F5610A2 for ; Wed, 6 Oct 2021 19:39:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239700AbhJFTlM (ORCPT ); Wed, 6 Oct 2021 15:41:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239607AbhJFTkx (ORCPT ); Wed, 6 Oct 2021 15:40:53 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0246C06179A for ; Wed, 6 Oct 2021 12:38:47 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id q19so2799510pfl.4 for ; Wed, 06 Oct 2021 12:38:47 -0700 (PDT) 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=JIr2Bk0QBgCC/Qyy7+5Gbgr8NQwlH0hHiIdNIEPo3fk=; b=bW+COjRtbI/s22IeVkOw6yQ870sBScBOBF2HCZngTnHoZtYsMfJOE0ofz7QpGYUlk3 /Vl4JW5K0GR+OgSiaMKU5lJV6dRt4U31wvz3SUiHBWgysFRhZ3ohDMdS5R/FK46EaSrt S4SHBAHlZ/K2wI81ii8OutsoM1QQJfn2XGo/k= 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=JIr2Bk0QBgCC/Qyy7+5Gbgr8NQwlH0hHiIdNIEPo3fk=; b=VfRczdIi8F0l3PWYx0kkad3RXi71RRlQnPAU7Iom7SWd5ppIr8pc2uZiAs3whuwL46 cS82v6GrghC9QXr1jNNjGsHd91L4RakJRgQXNl6I+E9maPCcmVidY1Hfa1S4HxHMdZo3 o7BxIOrpZyXgS1XgpN/myB9Dz2n+3tQJGZ0iLDhPOV49TuqAcJt2Di5F6h1lKQYCv7Co 9dEZE5po459q+FJw2+YWp59zSxe84zY9jlIM+5FraN5RXg7IuYBSydxlUl/WaqTf+qPF kRbl3u94rERuNlv/ybf5wflh4OvNkylxh4k/JXVHr6/gX9ntU1HCdOdvrc/lgbAsbszw ukvw== X-Gm-Message-State: AOAM532WC1Z/5lfpS+4aKlkgLH1h8xOz9BLD4k/kk06KSRsSi5qw0cn5 zLuiBPrfz3bNLOjTSssxIxPCbA== X-Google-Smtp-Source: ABdhPJxQwqQ7SCmgtuHD6Kn2a24WTCagZcGpwIwgH0tFHMKyN3or9U6DNvjkc8eAzPbVbEHcBDoHvg== X-Received: by 2002:a63:d709:: with SMTP id d9mr421671pgg.377.1633549127254; Wed, 06 Oct 2021 12:38:47 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:d412:c5eb:4aca:4738]) by smtp.gmail.com with ESMTPSA id o14sm22011296pfh.84.2021.10.06.12.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 12:38:46 -0700 (PDT) From: Stephen Boyd To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Benjamin Gaignard , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v2 21/34] drm/sti: Migrate to aggregate driver Date: Wed, 6 Oct 2021 12:38:06 -0700 Message-Id: <20211006193819.2654854-22-swboyd@chromium.org> X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog In-Reply-To: <20211006193819.2654854-1-swboyd@chromium.org> References: <20211006193819.2654854-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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: Benjamin Gaignard 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