Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp662549pxb; Wed, 6 Oct 2021 12:41:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpldWPCTNgJ9TNAZhdy1M7uYBE3nQlom2xeVzVOe7a+8RTWuewfdxUU1p/JcthvqTOPeSG X-Received: by 2002:a63:d017:: with SMTP id z23mr482345pgf.108.1633549273749; Wed, 06 Oct 2021 12:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633549273; cv=none; d=google.com; s=arc-20160816; b=vbhoFtSlyKcXqhT92N/sJMedfkz00mYV3Mf79BZho7tayhaUD0gVEZyR2kTerKFXQt QHuHJz1P0EC+5PQ9zTGhyUyU6q0RFhVeCENu41+IYfxeJtKkfb+aJCrOj5okQqv1MLAI 4UiAoFkbllOMh7b9WExBjuYTJEnmkIEAN2D0sVLDy7nDV9vNMrWmFwXBogEH7nFNuJ9K NjTBxyWO4BBu8nSl9g7Tg5XmSO4zxM8OJtD1ecvldaLcA2/S2QgpRPfJ5MSpP8NYkj2X CMgPvx318tlIusfokJFjB3PCJKYNnKR3Pjmrq1Lo4xyf214M6hK21qyllLw/uUnzWOOW r5VQ== 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=wZ50+nY6iKl4XzIgEo27g77S25bE2oAR00ZvAHfRl/s=; b=zrXtnWGNFmNstHdediEiImOykrlHsBMnro+MEothBzi5UW0pFmXzOZRqFI7RVMtHWm OOr0YvbwtRJOglEYy9oD2aYgVKmIaTpSxVAW9MnI14L6EaGDMmYpOWCOZTA8Wm74JSf0 C5eapBhMMHMVpgRGPcrhRhgvBzu06QfaL73PKNSeCJUhrIaRTREgmvcNLg6Ujx6wbHH3 sHI9O7rMSup1RFHBBdrCilSPKDTZuA8Qr0cFChaBFErXzqfPNfHbbP6e89YEL5pMXM6M icUbBDMqD4nV4gssmkHB5btklXs0a7+/F0oLZRDPmC01SU5I/Ix9Xd6BO/bcpYi7GhhB eeaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VAuNWWpX; 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 h128si6953842pfg.88.2021.10.06.12.40.58; Wed, 06 Oct 2021 12:41:13 -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=VAuNWWpX; 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 S239476AbhJFTkk (ORCPT + 99 others); Wed, 6 Oct 2021 15:40:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239456AbhJFTk1 (ORCPT ); Wed, 6 Oct 2021 15:40:27 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98D8DC06176C for ; Wed, 6 Oct 2021 12:38:32 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id v11so3388305pgb.8 for ; Wed, 06 Oct 2021 12:38:32 -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=wZ50+nY6iKl4XzIgEo27g77S25bE2oAR00ZvAHfRl/s=; b=VAuNWWpXvcDIC0EtmclApgGs3mUgw132HiRjwqx6qFpK7airfdQxAgppizP53solsC sbfIgh3sZ8h1i4NGIbFxB7GpyHzj25lS+98cfdXkHV4mEv1BdzftynD+NrGP0EHv1v4W MvKJy3mJ1XO818T/sKGM0Xd/N6A9Jk7VquK7Y= 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=wZ50+nY6iKl4XzIgEo27g77S25bE2oAR00ZvAHfRl/s=; b=d2OwRWeIXYMtDiTJ3eZ0oZw5LulGpmUWPKLzDhTcNd7SiAjvP5nkODrsp4prQQaXPC 0lcq++xyidSAZKi4mk+e1EzYd05qPhu6WwKzEOV4nd4dIzeeVBhEkVpeTU3rdryvPQDq zs+x72eAtsscJKhuwvhSdyUjEayHSrYuuXPRc0Q3405aw9aKlSvuxOkYSGB3Iih0toJJ dMjkmzTqJ3XXCuiMDttKXGPrGcCKNHsDVo8PoOgC78u7e8qZOwTZxq6Yp+wIx1dX02Yo bUHYNb8mR7GroFHrUuLcEUxcxim5IXJA0dKwL6v5LyWBI2QPAa4bmU1lR6AbNZiIY/ff uueg== X-Gm-Message-State: AOAM533n3Q9GFzP4fwi9l4Uiw5HtDvJppeO4MtQlVsxDJbIiAIggekVY TdcEZJWQ7DXM1anD9/NScn7RkQ== X-Received: by 2002:a63:c10b:: with SMTP id w11mr468986pgf.228.1633549112200; Wed, 06 Oct 2021 12:38:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 12:38:31 -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, Liviu Dudau , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v2 08/34] drm/arm/hdlcd: Migrate to aggregate driver Date: Wed, 6 Oct 2021 12:37:53 -0700 Message-Id: <20211006193819.2654854-9-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-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: Liviu Dudau Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/arm/hdlcd_drv.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 479c2422a2e0..8f3e5924042a 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -270,8 +270,9 @@ static const struct drm_driver hdlcd_driver = { .minor = 0, }; -static int hdlcd_drm_bind(struct device *dev) +static int hdlcd_drm_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm; struct hdlcd_drm_private *hdlcd; int ret; @@ -344,8 +345,9 @@ static int hdlcd_drm_bind(struct device *dev) return ret; } -static void hdlcd_drm_unbind(struct device *dev) +static void hdlcd_drm_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); struct hdlcd_drm_private *hdlcd = drm->dev_private; @@ -367,9 +369,13 @@ static void hdlcd_drm_unbind(struct device *dev) drm_dev_put(drm); } -static const struct component_master_ops hdlcd_master_ops = { - .bind = hdlcd_drm_bind, - .unbind = hdlcd_drm_unbind, +static struct aggregate_driver hdlcd_aggregate_driver = { + .probe = hdlcd_drm_bind, + .remove = hdlcd_drm_unbind, + .driver = { + .name = "hdlcd_drm", + .owner = THIS_MODULE, + }, }; static int compare_dev(struct device *dev, void *data) @@ -390,13 +396,12 @@ static int hdlcd_probe(struct platform_device *pdev) drm_of_component_match_add(&pdev->dev, &match, compare_dev, port); of_node_put(port); - return component_master_add_with_match(&pdev->dev, &hdlcd_master_ops, - match); + return component_aggregate_register(&pdev->dev, &hdlcd_aggregate_driver, match); } static int hdlcd_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &hdlcd_master_ops); + component_aggregate_unregister(&pdev->dev, &hdlcd_aggregate_driver); return 0; } -- https://chromeos.dev