Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp850743pxb; Mon, 25 Oct 2021 20:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxdF/hLfTRhZ4DW8PIVLQoPjvyu+llXjslx0gjv+CFgN1Xucd6AxOlD1XofEsfnM+lgjaz X-Received: by 2002:a05:6a00:1255:b0:44c:dd49:b39a with SMTP id u21-20020a056a00125500b0044cdd49b39amr23118835pfi.66.1635219267629; Mon, 25 Oct 2021 20:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635219267; cv=none; d=google.com; s=arc-20160816; b=k4ujH0AXzSXIkCt4FDRbwI8xnJuqZNMSAZ/gtSVSZfpFr0xBO3WNeUaUie/aXyQW7q Tz/k1yzBh3ZEkPcsUMmK+u0CN7fC0H9dSn7pMiLO2NCWFHx81BHtCEwe7GmYL84tjeYP ZxHCaA54yaTIZLKpn3r6rnG8bqB3ZgFB5SoaJNjwe9ydH1fKba2GUdMPEAcYQdR3mRdZ 4juAE+8nyDDx8Mb54MaRGFsuMv/KTNG2GgFTa27zYPggYQ42iKRTJPtR6asLqlwpnj3H RY8+JR7o2pfZJ1Myr7kWH1Igzqhd9BswmGmw3/7vn7NliqNxqjwUuClog7Cicpj1E0zD Gcpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0NtNoitnZpRD+QXZE528qbbYjh9dmwDBO87rVNizGkg=; b=cbDDuIKjTFvPWxn4beQmlkkm3FkwQYlsJpn8bptDvlGd6GdeyVSgde+vdxK9xpk6WL ytd0TzhZEUKpeoKBCTwzp21pwyx6zonEg60+gRmSQMqqgYsrlL+P+o3SHIDeokNuUHPO +Ub8zHEnIDGsKU8aXlnoTdTIswQaA8QGyNsOkPamrd9BrOsIfz1eLdZ0crR4uzGGOgUg wTDkyE5jYssuQihEokDeqQ0HI4IR20GlZMrpVkR3rrJCff6XJfoaqBL5Z3gcO7TGdDJL A/tIpnCy369Fq6Jq2FgAj+h2+skhuTcwVFw9HbI7+WZ9Avm+ApOTxK5uPx8K+RUTsFBV 660Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MkpS8mYX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si1109089pjp.107.2021.10.25.20.34.14; Mon, 25 Oct 2021 20:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MkpS8mYX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236097AbhJZAFK (ORCPT + 99 others); Mon, 25 Oct 2021 20:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235743AbhJZADc (ORCPT ); Mon, 25 Oct 2021 20:03:32 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF885C061745 for ; Mon, 25 Oct 2021 17:01:07 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id n12so4351409plc.2 for ; Mon, 25 Oct 2021 17:01:07 -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=0NtNoitnZpRD+QXZE528qbbYjh9dmwDBO87rVNizGkg=; b=MkpS8mYXYZqk/7Nl8cm+FACjFCj9sRfBP+cI4HAQV78Fb5HJmEC3lEI2D45nLTFAlE siWcKQrdjpkbAZLWqUTH/wIYNd05pSjofkRJAB90KF/7zgFj/bDbDpe3LcYfoGqW73Fu MRNCGUEWcC/Uyedqxrf8IxVsXEbqt1KtgUXAw= 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=0NtNoitnZpRD+QXZE528qbbYjh9dmwDBO87rVNizGkg=; b=LPV3hpuCCl/XCNeifRlT3DUGxP2+NExdJR3GX5OY7kEBFHNZEqo4fJruJXN+bPjJt/ QeCpYulMegFZlul8o3/TcAwqNCcoQWw3govOUy2ePOygELtQIWgc4Js+ae64Pa2ETz3x 4dXCsVogBrr5ovrVZuIEMH0Z0hovT/GMuVo/Dqo4pFz+OVQ7EVJVmFMwpbEiOdHiaHZ8 UnNRAA/8ICgO5PIRkfM4n/6xcAYRIyDn9hqD9UIVVfj/bj3icAqq801b2uqIZZBJcrHM nrRAGtJldPGCYhMc1tPeTvN7YJ8BSI7PnzDp7gFWx2u1+ssU03CoWXMXbKvym1lHOz7e xdbQ== X-Gm-Message-State: AOAM531v085/JcaPKyS0cCouVDVDiQWdMaIVZCbsNTRi5rR6P3a8caCR oozFmUukUfUxkUrveHS5LzWVng== X-Received: by 2002:a17:903:1252:b0:13d:f3f6:2e1c with SMTP id u18-20020a170903125200b0013df3f62e1cmr19295693plh.73.1635206467259; Mon, 25 Oct 2021 17:01:07 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:f5e3:5eb1:d5ee:6893]) by smtp.gmail.com with ESMTPSA id b7sm9900747pfm.28.2021.10.25.17.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:06 -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, Jyri Sarha , Tomi Valkeinen , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 24/34] drm/tilcdc: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:34 -0700 Message-Id: <20211026000044.885195-25-swboyd@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211026000044.885195-1-swboyd@chromium.org> References: <20211026000044.885195-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: Jyri Sarha Cc: Tomi Valkeinen Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index 6b03f89a98d4..d5c6567eec8d 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -531,13 +531,16 @@ static const struct dev_pm_ops tilcdc_pm_ops = { /* * Platform driver: */ -static int tilcdc_bind(struct device *dev) +static int tilcdc_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; + return tilcdc_init(&tilcdc_driver, dev); } -static void tilcdc_unbind(struct device *dev) +static void tilcdc_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *ddev = dev_get_drvdata(dev); /* Check if a subcomponent has already triggered the unloading. */ @@ -547,9 +550,13 @@ static void tilcdc_unbind(struct device *dev) tilcdc_fini(dev_get_drvdata(dev)); } -static const struct component_master_ops tilcdc_comp_ops = { - .bind = tilcdc_bind, - .unbind = tilcdc_unbind, +static struct aggregate_driver tilcdc_aggregate_driver = { + .probe = tilcdc_bind, + .remove = tilcdc_unbind, + .driver = { + .name = "tilcdc_drm", + .owner = THIS_MODULE, + }, }; static int tilcdc_pdev_probe(struct platform_device *pdev) @@ -566,12 +573,9 @@ static int tilcdc_pdev_probe(struct platform_device *pdev) ret = tilcdc_get_external_components(&pdev->dev, &match); if (ret < 0) return ret; - else if (ret == 0) + if (ret == 0) return tilcdc_init(&tilcdc_driver, &pdev->dev); - else - return component_master_add_with_match(&pdev->dev, - &tilcdc_comp_ops, - match); + return component_aggregate_register(&pdev->dev, &tilcdc_aggregate_driver, match); } static int tilcdc_pdev_remove(struct platform_device *pdev) @@ -581,10 +585,10 @@ static int tilcdc_pdev_remove(struct platform_device *pdev) ret = tilcdc_get_external_components(&pdev->dev, NULL); if (ret < 0) return ret; - else if (ret == 0) + if (ret == 0) tilcdc_fini(platform_get_drvdata(pdev)); else - component_master_del(&pdev->dev, &tilcdc_comp_ops); + component_aggregate_unregister(&pdev->dev, &tilcdc_aggregate_driver); return 0; } -- https://chromeos.dev