Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp849803pxb; Mon, 25 Oct 2021 20:33:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyje1vedFWjllnxvsU4A9V/s/mzV3pJA8Feh6tFLLaWrl5To4Yp250leto2a4LYaXY/dE+b X-Received: by 2002:a65:5082:: with SMTP id r2mr16693540pgp.353.1635219183649; Mon, 25 Oct 2021 20:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635219183; cv=none; d=google.com; s=arc-20160816; b=X7Vs3vTQB8AIv0LEhuT+k5pgS7Hu2K7LJcVhHq3uBNhVoRjOUDVvF8M0DL6ZxyPyJO I9TYj9ti1FJeJZMfccMKGEAHFaB19rXAbtEOhA9JlIxT57A5D+Z+7jPBfYlowq5iDjEj JB2moDauFJLDldRfNLQZi2QicX7XpiCdKHUwKXXONvzVXZya2WXrjMb4OLINLN08yEFe 8Z/oXl7RWOsrqEFLus3kgAJFWTQOZf12HFMubphcB+Egj+zRYVHtk4EHx9big9bbWwTE p5H0grLevnmGvyJdehHhRt0D5bPd+3bt5q5vb/EvtlsdhUIHJbprCg19CGLZlr6ygBHo r6CA== 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=qrvKBJr+DUbrISc8WyZICnsdtffozhNCQiB3CMiYO5U=; b=pnxW6lOIDA3rEL0vtXMkdNz+Z9rEnuFwXEVB1gTV85NIh4r45ktD5ZSaRiM2JsYqHO 7Xgks7Itz4hqLiABMaqKd3cJ+CkRVKryEGu+6A681maWXkW39wGEC650aJPMCYMY9etw NW7KqNmB2mmBXf+LXnXDMB3+hDf0Zmc4m+h5bcn5kyFUOd5D8Ujl3SdOQm++Orzwsl8t B1/xCoyCnNSPpzxiGsai3mu2fvsoRy2wrmfxyUx3oKqcGPWZncT8A4yN0fPb0E/T4bKA td113SHYzG20Qrrnl0fo8F5NFj74hpz9F0huOicoeE9ElJGVg8I3Hb4PzDGYHuBnhRqG QzEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eBJkD88K; 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 e27si26929845pgl.492.2021.10.25.20.32.49; Mon, 25 Oct 2021 20:33:03 -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=eBJkD88K; 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 S236222AbhJZAE4 (ORCPT + 99 others); Mon, 25 Oct 2021 20:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235727AbhJZAD3 (ORCPT ); Mon, 25 Oct 2021 20:03:29 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDDB9C061243 for ; Mon, 25 Oct 2021 17:01:06 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id a26so1664968pfr.11 for ; Mon, 25 Oct 2021 17:01:06 -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=qrvKBJr+DUbrISc8WyZICnsdtffozhNCQiB3CMiYO5U=; b=eBJkD88KGHZoyjf0uyhFOf6hXmXPj8CyJleM8bF+Z23T3g4hjnvuyInTyDrdIQ9Vvf PD9uL+5hQbzCJTDU5CukFarTB0O6VL8TK9y55i+Sli1EZXzjOY0sBvIDGQidzFo/X2dI Me3sFLyu2nTabjMtPst/dDZ0g8ftVN4RrqTkw= 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=qrvKBJr+DUbrISc8WyZICnsdtffozhNCQiB3CMiYO5U=; b=CiftG7W8JOZQ1MQ6TXfXKbA1sObD+6oHmn9fxiLtNh7OaFkk8jRsKFczRttJ5e07xo uyoG8MlWSB5orgobkt4tFR2HVZ3hgdOfTh9a1G79pOb44qRAd4vgHsL9tkTkrOT7Ksn2 iUS7byQGwnh/p0ecfmSgyToVL9B4wR3tjbfk3QSPVh56uWvns5sAET+KbLwZj2iEe0iq OdG2hiOBgGTeDY+gEFjmG8hT3F7GT1h27hwFs8dtIotNCWMcRT/WqpQDLvUrvLkNdbpW BhCGr953GAeOzTC61LuMoHiwMgYFFXX2HnBMvvX5TXl4Lw+fpj6pPS6BRPJOEIO272Aw djpw== X-Gm-Message-State: AOAM532FbisYvPnPY/SDkOlxY0ccqsegSJgXKj375VUhYAbZVuozG5tz ge/b8SDdrXzQJwKrqspG6kKKrg== X-Received: by 2002:aa7:9043:0:b0:44d:13c7:14a5 with SMTP id n3-20020aa79043000000b0044d13c714a5mr21906414pfo.86.1635206466351; Mon, 25 Oct 2021 17:01:06 -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.05 (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, Maxime Ripard , Chen-Yu Tsai , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 23/34] drm/sun4i: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:33 -0700 Message-Id: <20211026000044.885195-24-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: Maxime Ripard Cc: Chen-Yu Tsai Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/sun4i/sun4i_drv.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 54dd562e294c..700f5e32eaf7 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -56,8 +56,9 @@ static const struct drm_driver sun4i_drv_driver = { DRM_GEM_CMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE(drm_sun4i_gem_dumb_create), }; -static int sun4i_drv_bind(struct device *dev) +static int sun4i_drv_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm; struct sun4i_drv *drv; int ret; @@ -125,8 +126,9 @@ static int sun4i_drv_bind(struct device *dev) return ret; } -static void sun4i_drv_unbind(struct device *dev) +static void sun4i_drv_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); drm_dev_unregister(drm); @@ -140,9 +142,13 @@ static void sun4i_drv_unbind(struct device *dev) drm_dev_put(drm); } -static const struct component_master_ops sun4i_drv_master_ops = { - .bind = sun4i_drv_bind, - .unbind = sun4i_drv_unbind, +static struct aggregate_driver sun4i_aggregate_driver = { + .probe = sun4i_drv_bind, + .remove = sun4i_drv_unbind, + .driver = { + .name = "sun4i_drm", + .owner = THIS_MODULE, + }, }; static bool sun4i_drv_node_is_connector(struct device_node *node) @@ -398,16 +404,14 @@ static int sun4i_drv_probe(struct platform_device *pdev) } if (count) - return component_master_add_with_match(&pdev->dev, - &sun4i_drv_master_ops, - match); - else - return 0; + return component_aggregate_register(&pdev->dev, &sun4i_aggregate_driver, match); + + return 0; } static int sun4i_drv_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &sun4i_drv_master_ops); + component_aggregate_unregister(&pdev->dev, &sun4i_aggregate_driver); return 0; } -- https://chromeos.dev