From patchwork Thu Jan 27 20:01:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 537678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60FE6C43217 for ; Thu, 27 Jan 2022 20:02:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240157AbiA0UCM (ORCPT ); Thu, 27 Jan 2022 15:02:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343673AbiA0UCG (ORCPT ); Thu, 27 Jan 2022 15:02:06 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEEC6C061756 for ; Thu, 27 Jan 2022 12:02:05 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id c9so3660200plg.11 for ; Thu, 27 Jan 2022 12:02:05 -0800 (PST) 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=iMJcZepLim/YpIi7Y7hIab1z+GE+IIU8h9QgrFmMU/0=; b=OZNuVGwmg+5DpXtgxq+BMEkKae3EDK19392kSo4/J2z3xPzFGcdXFvJ1uC38LmN+lD RCdoVkHQwjCTjT9aJVj8uGSKfPaj4VhZ6b3P8SwCCKGRNX03bgKzXtD2isYFr1AFNjHr VPrC3gXCOEEDHIF0ibxT9aiOAQxnq9XdvcSRI= 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=iMJcZepLim/YpIi7Y7hIab1z+GE+IIU8h9QgrFmMU/0=; b=KLB+c8TAg8L4PFbbuNzHgIjxhxw6xEyn+Vr7iEPzUzytRqPAo2WgJ661nmQMBeFcHq 2YixpHDhFFi0VUKMLKCt/1OVYFr9TV46W/LB/aoDexiLYcPGadEnKnYOYrk9F3lJOUZP n3klWOx9X5RPH2NP0Jp3ZsSYB5GmRZdijCC7OvkksU/L35OqKxnqbgKREzUkPGwoCRf2 UCL3nCsg+nJKch4vIjDve4CPJCmdlDji7R0UYX3PH2r0VAkspUzSc+bSdCdtgMSfkCOO WaL2C3d3s+Hvh1nRE4gs7T5EopoieLSDfy0u+Eb+Tthy//IhyUKVGjlJ3vWXq3XYrtDi OfLA== X-Gm-Message-State: AOAM531PsE7IDtJLwXT+ov7UnhcYAkj1M91CaPPP+Ztu+a764koeaKbF m+pNyF8CHtwz3uDcxS9/nr0MZA== X-Google-Smtp-Source: ABdhPJy5iEP9ZiYeQrh0T9dMlgNgumKZeRB+e4a/VBs0O8cCc+ML1Kugu6geT3ueGmazrHLnrAbX+A== X-Received: by 2002:a17:902:ab49:: with SMTP id ij9mr4763950plb.1.1643313725021; Thu, 27 Jan 2022 12:02:05 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:9246:1838:3243:3071]) by smtp.gmail.com with ESMTPSA id k21sm6561190pff.33.2022.01.27.12.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 12:02:04 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman , Douglas Anderson 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 v6 08/35] drm/arm/hdlcd: Migrate to aggregate driver Date: Thu, 27 Jan 2022 12:01:14 -0800 Message-Id: <20220127200141.1295328-9-swboyd@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220127200141.1295328-1-swboyd@chromium.org> References: <20220127200141.1295328-1-swboyd@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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..e3ed925797d5 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 = aggregate_device_parent(adev); 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 = aggregate_device_parent(adev); 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; }