Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp929653pxb; Mon, 25 Oct 2021 22:45:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSWNlmMmFPR/YZYI1e+RTvntpCzfuO2xEyOMi2lkk47LMJ6GcxBZs6jF/MPQ9qdyV3AfTV X-Received: by 2002:aa7:83cc:0:b0:455:c394:caba with SMTP id j12-20020aa783cc000000b00455c394cabamr23901603pfn.28.1635227133138; Mon, 25 Oct 2021 22:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635227133; cv=none; d=google.com; s=arc-20160816; b=vwdLsuSw3NmTVTzC/FSMFxNZEF94kdprMJ/frT8d/stFKpitEF67uOhE5tTDXOgrJ8 uCflb5f95vR84rhuSQ5ghDyPo1jiOCOTpCrxHn3BpugPhnwE3eKM/lPhvWkiaG1I4Ovw z/XvoUthkaCZybanXCbxR2q5ktB8HRYhrz04mB0tkV+hQRXLxG1qqRzDOr93EUHQqnUy n7DSy/79vfzrem0dylxN8uOaYPO1zv4cKkUt/73bepc/xLwqXeJ8SGOcgqtxQvHQdDTe R/IHDQw64x05xh7hl5RFMv8rPchSoOHJeQzbDkferbRoldaZL2Q6pASvUXv9t/hQOlSp 11ew== 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=QdKC3RDnWMeVhqBKuTAcfq/eZBHYEe2Kb+X7ix5SdpY=; b=NVBwo7Gonym8IjbGyg6O88khGEuiGKTa7f+3Z7oZDJwBVQ2gm7LW7YAXDAIyaz9sFw VbH3VML5UJg1oVrT9/iSXZfT374+7EAG4ScRtjLN2oEVb+3iFnjAIjWuIGAfRNpp3j/c 6MgOzy41EzXZSB7fmlrhn8ezYYxpn3ZtKOoevkSqHENYu4sAq1EX+CGmVPiKDvCG6bir lN7VUykTzlMCIBBWhmNY9ZnQIvrZ8xhipiTFGmNvuZJjoZ+mf6IluxQpqYULnbvGS4A/ GWsd65MrHaQHZ3S7npoWozVemkAis2XxOyqGRUsK/LIj8aLx11oDev9ZXI6KY8LgKEZO 1dWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ScBbBZrE; 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 me16si4534671pjb.74.2021.10.25.22.45.18; Mon, 25 Oct 2021 22:45:33 -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=ScBbBZrE; 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 S236370AbhJZAGe (ORCPT + 99 others); Mon, 25 Oct 2021 20:06:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235554AbhJZADR (ORCPT ); Mon, 25 Oct 2021 20:03:17 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 174BDC061745 for ; Mon, 25 Oct 2021 17:00:54 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id m14so12477386pfc.9 for ; Mon, 25 Oct 2021 17:00:54 -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=QdKC3RDnWMeVhqBKuTAcfq/eZBHYEe2Kb+X7ix5SdpY=; b=ScBbBZrEAh2lBChYx/tCIpUXX8xvkpEqsNKFZx3qbRUi/82oySHk3vV6s7gy+WjO6d GD9J4lxRh7r9GFCln+KzcqOonD5rUsO6W6K8W7mNy+wk/aJ2bWJS/6zLnW7OYX9VOJf+ gC3AlR3tRBnO/SBzeXgstVka9muvTag4kQJe8= 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=QdKC3RDnWMeVhqBKuTAcfq/eZBHYEe2Kb+X7ix5SdpY=; b=P8xpZmo5uDuIqGaG6KGNktrxsMaP2KiLnlEevy97/z0Uto7qhJyEcSS1hIkvbOKkXJ Ta364QFo6yV0G5qpdfWDOeZusSqBI1YGBSh+N9FZXYkzVwYKqHSDerynSsbp3Gh/OY2d 1QISZazY8IQETab2UQbI4EdqyHbVA8XbfbXi0ZYoGxaM+HI+BTZUKVAfNXYvmyV0iSwH aqimxauPrgIqjPUlQqPQVb5FbUUp23B26b0ZQFWmLlPs2sME1ciBLw42PuF+F3JYPG4T tPbqW2YARuMGjEzO3vgeFSSh2iao9/O5T/Kk4CO+OWhzYTUQtWbBkYiJ7sukqBL6/zbq t0vQ== X-Gm-Message-State: AOAM530si6OVIf4rqI9fLDkxd9W8ztIUgxRRXJmBLHVV1IADIw1XNrnl SgNRhLHyj3+0mRPAmkBWCdo+UEgKnuc= X-Received: by 2002:a05:6a00:1501:b0:44d:8dbe:ca59 with SMTP id q1-20020a056a00150100b0044d8dbeca59mr22500474pfu.75.1635206453554; Mon, 25 Oct 2021 17:00:53 -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.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:00:53 -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, James Qian Wang , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 08/34] drm/komeda: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:18 -0700 Message-Id: <20211026000044.885195-9-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: James Qian Wang (Arm Technology China) Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- .../gpu/drm/arm/display/komeda/komeda_drv.c | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c index e7933930a657..0463386a6ed2 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c @@ -25,8 +25,9 @@ struct komeda_dev *dev_to_mdev(struct device *dev) return mdrv ? mdrv->mdev : NULL; } -static void komeda_unbind(struct device *dev) +static void komeda_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct komeda_drv *mdrv = dev_get_drvdata(dev); if (!mdrv) @@ -45,8 +46,9 @@ static void komeda_unbind(struct device *dev) devm_kfree(dev, mdrv); } -static int komeda_bind(struct device *dev) +static int komeda_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct komeda_drv *mdrv; int err; @@ -87,9 +89,13 @@ static int komeda_bind(struct device *dev) return err; } -static const struct component_master_ops komeda_master_ops = { - .bind = komeda_bind, - .unbind = komeda_unbind, +static struct aggregate_driver komeda_aggregate_driver = { + .probe = komeda_bind, + .remove = komeda_unbind, + .driver = { + .name = "komeda_drm", + .owner = THIS_MODULE, + }, }; static int compare_of(struct device *dev, void *data) @@ -129,12 +135,12 @@ static int komeda_platform_probe(struct platform_device *pdev) komeda_add_slave(dev, &match, child, KOMEDA_OF_PORT_OUTPUT, 1); } - return component_master_add_with_match(dev, &komeda_master_ops, match); + return component_aggregate_register(dev, &komeda_aggregate_driver, match); } static int komeda_platform_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &komeda_master_ops); + component_aggregate_unregister(&pdev->dev, &komeda_aggregate_driver); return 0; } -- https://chromeos.dev