Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp851008pxb; Mon, 25 Oct 2021 20:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+OiQO6dI8biwqVhu0G70MRiy3YPjzbJqHQDdX9GbVFG7xx/Yyg4mBYFmUD+DpvbwLX+un X-Received: by 2002:a65:6a0a:: with SMTP id m10mr16867523pgu.82.1635219300410; Mon, 25 Oct 2021 20:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635219300; cv=none; d=google.com; s=arc-20160816; b=ITKz8PwJq4/ayH8FpZG4zxXCEQx5JhNyM53eGSOMz0xUT5arY978jRd9f6qC9ODee3 2uSEczSUbQak7X1gzIJqfjNU7YVT+jP2G9eKNOA+TgpFdkQWCr7u65fZe0DUKFvMpayN BktLtzh+jxKIjlP2Pil6GhMMEGvUYXPVaNPH1pHViRYHRJ1EBlg63CxS+q2oltPlRLgQ hWQLJ+XSwrKhYnzpmYduhwAZw3dQmm3yE9oBlnC/GRNMTPnRewBrTL3WNbi/qF6vzhpk dhen26tmVlfxQJ7IGDuRjd2fCH2d2GkocPFY63NBkjrYbH7BveLIHyX+QcxrdtyY+qIU hrag== 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=f0lZGXHwPviChh1qGaLbcibaQ5KdksPeQeI4kBQa+kk=; b=uTt2Y+HRRyiq89W/1XvvzVBFg2sar69BwtdVqZSAB0fzzbvpyAqEJnH4lydlh05VQR iXTHuLEYxTppWMmhbvhjFhNN4Safa5g+S5n3EMFV6AZRWDSItd4IJamA6nMWlajAVPct t4ynwvUS9olZNMD6hQsupoSbCgQESMRiaXgISr3FBJLApFEM8oF1h22eNOMK8mHY9S92 rmdGzJADLSDpVjWB1OTPree4mEpYs+hi3RVB08EC0kryQe0DYGoFNFb/lk2IoG8b/q7e b8wE6Tzv3k6ixwG+Q3ailBSaU9wbg30ye3gUqNzPhrs9tEl94BERIUb6JyRvVM5MPgov XiRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=H1hzoo7A; 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 l16si21277933pgc.45.2021.10.25.20.34.47; Mon, 25 Oct 2021 20:35:00 -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=H1hzoo7A; 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 S235707AbhJZAFV (ORCPT + 99 others); Mon, 25 Oct 2021 20:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235506AbhJZADf (ORCPT ); Mon, 25 Oct 2021 20:03:35 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DFD0C061225 for ; Mon, 25 Oct 2021 17:01:09 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d9so12492255pfl.6 for ; Mon, 25 Oct 2021 17:01:09 -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=f0lZGXHwPviChh1qGaLbcibaQ5KdksPeQeI4kBQa+kk=; b=H1hzoo7ApLY0uMJvD00N9D1TGkRyxQQ2zPFTrbqzvm8Eh/4pc2vK5MtOBBHuUiowY3 FUAbCmmBwO/f39RptBMJ90w2W/Hxa7CwARCNSixhMIVaqZneEzwoxDPEsSKm60jgebE/ 88LkkD2FeU5dXvxGZ6jRrAgs61cTlNQgZ4l5M= 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=f0lZGXHwPviChh1qGaLbcibaQ5KdksPeQeI4kBQa+kk=; b=Ruz6hPX9IULzNzBhG9t/kxlYS86XXGHwkCDJw8EJXFgLbHQI+dL+/z0Uzi9nc7mBPq EvR/dSw/Yd5WspOcGFGggCKVYcdyTNjB/Vi5hGfSL5qpFh+TDWe2FGRoIXXlZROTttej 3sjCRx11kvLqZeLh0WyUEO4Unmk7CSLxNx3sJLqMLFiftY9pHuRbessC/U9LYeoIlvuf x/W/xDG3cfYY7YDpvXo69F2GbrQnIwT74VjqkNcnHMtJDY10MITiWwFrGQaddRY3AYWE PvoaTTZsS0tlX0KbLnWxFhi7RSEI96GSKcXoFiDrZKbA8BCTIyXB+zdGhCYtLX67cOWk OmQg== X-Gm-Message-State: AOAM533bKLm/RiKNJQYBSEi2OCVyD8U/T1MJqPgMZrjzefj+iYHKECAq Mq97oCwk6GJMQjzgpmvUSI+wG1lUdR8= X-Received: by 2002:a05:6a00:1950:b0:44d:9402:3396 with SMTP id s16-20020a056a00195000b0044d94023396mr22065351pfk.70.1635206468897; Mon, 25 Oct 2021 17:01:08 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:08 -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, Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 26/34] drm/zte: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:36 -0700 Message-Id: <20211026000044.885195-27-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: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/zte/zx_drm_drv.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c index 064056503ebb..b46f677ea51d 100644 --- a/drivers/gpu/drm/zte/zx_drm_drv.c +++ b/drivers/gpu/drm/zte/zx_drm_drv.c @@ -45,8 +45,9 @@ static const struct drm_driver zx_drm_driver = { .minor = 0, }; -static int zx_drm_bind(struct device *dev) +static int zx_drm_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm; int ret; @@ -97,8 +98,9 @@ static int zx_drm_bind(struct device *dev) return ret; } -static void zx_drm_unbind(struct device *dev) +static void zx_drm_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); drm_dev_unregister(drm); @@ -110,9 +112,13 @@ static void zx_drm_unbind(struct device *dev) drm_dev_put(drm); } -static const struct component_master_ops zx_drm_master_ops = { - .bind = zx_drm_bind, - .unbind = zx_drm_unbind, +static struct aggregate_driver zx_aggregate_driver = { + .probe = zx_drm_bind, + .remove = zx_drm_unbind, + .driver = { + .name = "zx_drm", + .owner = THIS_MODULE, + }, }; static int compare_of(struct device *dev, void *data) @@ -135,12 +141,12 @@ static int zx_drm_probe(struct platform_device *pdev) for_each_available_child_of_node(parent, child) component_match_add(dev, &match, compare_of, child); - return component_master_add_with_match(dev, &zx_drm_master_ops, match); + return component_aggregate_register(dev, &zx_aggregate_driver, match); } static int zx_drm_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &zx_drm_master_ops); + component_aggregate_unregister(&pdev->dev, &zx_aggregate_driver); return 0; } -- https://chromeos.dev