Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp758483pxb; Fri, 28 Jan 2022 09:19:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzEI5uO1jdc0V62n3ff1TYUUNcqReWIFF+aV41Q3JJwFS55P4j5jNlt/tyFe8gfA4Ka9fK X-Received: by 2002:a62:1c8b:: with SMTP id c133mr8924556pfc.33.1643390390236; Fri, 28 Jan 2022 09:19:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643390390; cv=none; d=google.com; s=arc-20160816; b=YV3RV0h0m7k8XCNNs9J/LVwbPBe09JRILhCLy3uZSgJK9opmj7d8OIS+hnAQq+eGwa NDIS/eqL7L+x9jhCI/s5VGrXZk3TMOOiWdxI59nl7u4YKyrX/FMV775TNKMsLaeAgzY2 Sme8luG9nWS0pHPCYhXqvuDwxyUtSoQStzhsun4VKfe1fVu08vun0Nvd5rTViFi9Nutl r27XBLvMbbLGrdn48fgfoMvpHB+HrqeGCoWGSp2qk3F6ZT2CsBzkOgBdOJSngNHi6Q+h ZqukEqZXqUGcFhKGEPoyOVzAjA2UnMVJEfGOg9/QfFUUX0/9DBZFUVJQv+o9XyRoHDk2 ffjw== 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=km10INCJaOtDHcOHVEwChqxOVacq/jIckMelDPfId8g=; b=oSGRw57BsnxpVSVNO7AYvfuGYAYhSqT8nN6VS3aXNRA0G9bdCdd0n3Qp+79sBfZrae tlReQYOK8ZMcOSemPAiBFRz/A3FcJvSvAUotaZbIw+vaYvk8QpNT4szutGUl0+wFSSHF zW3munuRI2J2hyIdAFKnE+NiMQz9ew92XOjapVztEt19b6ReyohZaPD81sWpjYNxW2+d jFBoVR3mKCYSxSeHP6Q0c4ZaPb/vhq4L1+ypjcWCg5TWG9vmLZhLHayd2wGyUcW/HKjr /1RV2o6Unys4O2CInx9Y9kI/YVcVie+8sPKDVuUCA0gV8j3xgZTuFMBB9cg49ZT20WDW rTpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=J8JG6dKa; 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 y4si6032764plg.427.2022.01.28.09.19.37; Fri, 28 Jan 2022 09:19:50 -0800 (PST) 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=J8JG6dKa; 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 S1343760AbiA0UDz (ORCPT + 99 others); Thu, 27 Jan 2022 15:03:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343827AbiA0UCc (ORCPT ); Thu, 27 Jan 2022 15:02:32 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3C6C061714 for ; Thu, 27 Jan 2022 12:02:22 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id o16-20020a17090aac1000b001b62f629953so1213859pjq.3 for ; Thu, 27 Jan 2022 12:02:22 -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=km10INCJaOtDHcOHVEwChqxOVacq/jIckMelDPfId8g=; b=J8JG6dKaTSgfj58AmDZpi6NnG+1JvETfnLcowzBO0x3Qy6rq53OG3iQ8SC2QccH5or kmgbyTIrVRw0FWOwvHltipYgDOSZF7UsNLQJmt8RPYt7bZEC1QEFqPorauhu3o+T5eYP kfOEQHep0THj6hqQ1LSBWSiaqR3ifg2OFHhXo= 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=km10INCJaOtDHcOHVEwChqxOVacq/jIckMelDPfId8g=; b=3+jSmePgQHnxikB9uCf6rARmcPSAzv+VdwSQ2p6kTBQRsirpwxmWqw9CZK3bCithbY 5pa4veECokE5rFaxdFiRfd59Sw89josVK7+pj1d4F4epgio8BKfHszmOYWA2FzR3prL1 qAXSc6QCucPWtZLKgIbSudx3O2WfVujWX/H7ky+cImPqYdnDJLyP8yzRnrnV44PQA8Qy sjg619anWRLu1W0MNeWllVrc5zt109PDm4uZY0PccE4KnKmjpmbc2OTQLCcm8q3DwjQz h53KzZQgWnJ33t05dBMX3Igq7YHKhTjlFrXGVDMDzOyhdIPYOy/jNeOVNwAWo5dc/a9V fHcg== X-Gm-Message-State: AOAM533DlsPHbrKCSwCSFHHdZpV59+XNxz/p7hoF0dYPoai7rUuUjAQr ChR0BNzF9fb27vdkexgY05g38g== X-Received: by 2002:a17:90b:1d91:: with SMTP id pf17mr15477568pjb.160.1643313741993; Thu, 27 Jan 2022 12:02:21 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:9246:1838:3243:3071]) by smtp.gmail.com with ESMTPSA id k21sm6561190pff.33.2022.01.27.12.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 12:02:21 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman , Douglas Anderson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v6 21/35] drm/sti: Migrate to aggregate driver Date: Thu, 27 Jan 2022 12:01:27 -0800 Message-Id: <20220127200141.1295328-22-swboyd@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220127200141.1295328-1-swboyd@chromium.org> References: <20220127200141.1295328-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: 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..958db315d547 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 = aggregate_device_parent(adev); 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 = aggregate_device_parent(adev); 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