Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp844948pxb; Mon, 25 Oct 2021 20:25:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy55q7rr1Mxk2LEvpvclHmmLQg5fd1CPPYmbgKPu4TM/q5X3XZYNPOsqrSatpj4zUzNoVGI X-Received: by 2002:a05:6402:11d1:: with SMTP id j17mr10295505edw.139.1635218740609; Mon, 25 Oct 2021 20:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635218740; cv=none; d=google.com; s=arc-20160816; b=IJ8imN3gDC+wZxZR8ugohszLSUEukihv+gwx9Go0P6hFwpQR7iMTdiz4vt3+zzg3yY rJt/9Whal6XEvKM3MghQmDi4V4UoHi54EmoH6uosEBvIip4rC/p8oH3rv2PYj2tn8T2p nlaRIcWYYXAM7rHjtcKatQkYK7rswLWpN06DuV0f7X4+pMzRFGnPHOErQm86EXx3sYar alvnGA8/FyFopkXvsP1ViTMXFOIgik6VG9GA8syCvaEr7aeb2QFitPvQIRLmiOP+0bX1 V+MANvR+r92pIZO3Jr1YbuXkKRB6Pn+CaU3AiehkCtc2FRCSW++Dy/6l5oRLOzOHctn/ 5IIA== 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=udX8aXVKtCgorZpoo7KBRMV9fl84l0zJ44mq5nPYnXQ=; b=niwrpjd2ti3wURQtrhVsYjX+lTg+UHjxdSkatK82sAVmQ3HyNtfS+c6ByIIZ3ukFLF cP1+YqwFvorIXlO14LCTQ4460avpEFPxUa7ytmBBqqFZrxomZV88YDEhR72/VwBYwrsA Z6bWb4eX3A8/71m8x9jN7ywrUnwUYCcH65Z/+/3HsbIrk7e0nwU4nBD/EFaf+RjUptqX XCDLZYZTt5kjESQwJ4xiClqR7LV9eGHma82p2zN9ue11ogkZ0rgmgh+WmINYmi0JC6c/ gqckEnQw7RND00gY4ok5kR2sAbi85tmn9b+s4/gCfCJlQveb4dCp1Fsk1p21HMXkHusL bcZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oOYmIe4U; 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 b15si7965876edz.346.2021.10.25.20.25.16; Mon, 25 Oct 2021 20:25:40 -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=oOYmIe4U; 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 S235883AbhJZAEB (ORCPT + 99 others); Mon, 25 Oct 2021 20:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235562AbhJZADR (ORCPT ); Mon, 25 Oct 2021 20:03:17 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE389C061348 for ; Mon, 25 Oct 2021 17:00:54 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id f11so12447229pfc.12 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=udX8aXVKtCgorZpoo7KBRMV9fl84l0zJ44mq5nPYnXQ=; b=oOYmIe4UvKQQvisPK3WuEw7ME4lP+nazSx/hRRpLY0yBbhMPCYujJquJIK5b94R8jp 8sbFQOc8KdXO5SC2t/68pNHSVGvIVLpalP7a5LBhlDTOi/jkkpZ82StuSzQcYtUdQjY6 82iQNKg40+yF7kNn5Wkbjv7yn8gR7Ocj/Z6WU= 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=udX8aXVKtCgorZpoo7KBRMV9fl84l0zJ44mq5nPYnXQ=; b=ONx+FzvorFk+DJu+OxN5TAxB1Q4BlNPjZwwUj7LNdYLX8qEQAz9jcvffDeawm5vT2o MvY9/hvaf2KskK9XabulHmGmT4k7qQKUAQLDBHF0RajQvmnZ+vKaAuraHafbjrfjXBfq WFkiaO5SMY66r0KsxBoxTHHTmzMHbsBrPocvBT6eCe9MLz0FEbAnVec4gsuumQGf0Brt xTwsIhegXAqquspQV93VsZL77B/CjAYBKu3xQI+uVq4T/VdJrtY+LL1a4987vE5I6CxF +KOGebGogRV8SbFeVtSgKKdbt1keNTroc/XTGm9zbQMlvyeFFng2UYFPQGcS1Jh0hOIv 5+9Q== X-Gm-Message-State: AOAM532G3LCWu2iDnJjWgo6n13qmGvyCD/l6Z9r97GWHM+B55rL0zA9n 5oSoN9tIG1hx7RfNmbI2KMXPTQ== X-Received: by 2002:a05:6a00:888:b0:44c:c00e:189c with SMTP id q8-20020a056a00088800b0044cc00e189cmr22176793pfj.79.1635206454412; Mon, 25 Oct 2021 17:00:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:00:54 -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 v3 09/34] drm/arm/hdlcd: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:19 -0700 Message-Id: <20211026000044.885195-10-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: 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..5c03eb98d814 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