Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp928622pxb; Mon, 25 Oct 2021 22:43:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjRbNCxRzaK4uFddf6GO0q7MDNUk30TXzzg/TcFHfdlr3M6KIV72+6PtUtUqkiP2Ehd6FC X-Received: by 2002:a63:3716:: with SMTP id e22mr9206729pga.75.1635227023729; Mon, 25 Oct 2021 22:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635227023; cv=none; d=google.com; s=arc-20160816; b=q5ZOkE0+S6SrRW3XHCdcoURnogrTGmOlhrQgBvACtGI4943wkhOARLyVBRrY3qinPh CNhUXECg28QYV3+uGg+nugbp0Sg0xK2ZrqWBb2F6XvRwP6XJW5ZGMfIIL8mmWc2psJpf /lazaesuNUDPB7ICQFKroUTkGl6GL9jx5ZM6QlXETomQ+AlSwN1vNW0S0cXHDV+EhVK4 acZ7XdsTIkySKbAw3KXHshBbtshwLAn5v/xteW3xe93H5YYAbWez2CnKxfOuWMb7MMCW 7eHBrIFBupZ8tQ1VHVIUrSKGblbV3JE41qnFUfUt5oee2tD6XEXmItEDZkuoQh48+kvY XC/Q== 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=uzJHB9t+Bicwdag3X6iL63lm7ZGof5i0wMOcRCsHtBw=; b=nO5dflAsCp5r6TOo3pm6VFX3KKHK2luSDkvFy4D0F0n224xDQroLDCQ23ePcQefqGV +9ItqjaSY08JTbp+Mj3xbtkj4lFp3fpQssXg/m1dFe3xa17YjJvzY4SVONCpAT9Qkn2o 9hlSDGaovgA099EhkJysMQs3gl6rmCOCk6DGMXi53dHde9k6WCDGnRtrDuoa4nRX24E1 uWNRKkRnFqvR0OJV6Zs5/Yg7wexNRRgQvp5vRzsxWR3WrM8nQ4RS4jIIPO18J/MnaWrd GyfWaJKGTYwAGwee3/I3lKtgiAe20wT9cZeXvfysSs7BGZAr9yZUQZX1KK3uqN6Xhs56 Xiyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=boke8wkv; 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 u20si33370982pfk.226.2021.10.25.22.43.31; Mon, 25 Oct 2021 22:43:43 -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=boke8wkv; 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 S236232AbhJZAF5 (ORCPT + 99 others); Mon, 25 Oct 2021 20:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235787AbhJZADg (ORCPT ); Mon, 25 Oct 2021 20:03:36 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 358DCC06122A for ; Mon, 25 Oct 2021 17:01:11 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id e65so12288657pgc.5 for ; Mon, 25 Oct 2021 17:01:11 -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=uzJHB9t+Bicwdag3X6iL63lm7ZGof5i0wMOcRCsHtBw=; b=boke8wkv6Aham8Rt4L0L5vG7+UiINMv54CSRwWE5RydVsN59BHDs3a+awA6esz9uWu XwHPcUKkuQb3LB/LRTLBkKJvP6FpQE+PQYWhEP1O1RLc3qhDd+SM0K/laNL0JQ0YB3WL +NauKlzlORpgl8Fmq31rtSDDkSwXwjNEJ5zpk= 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=uzJHB9t+Bicwdag3X6iL63lm7ZGof5i0wMOcRCsHtBw=; b=LQCRMvZbQMrTF60mclF6qGRWTc9o9epzvtPlJcvW/bZf10hJ+nw+ko847wD75rhUPE yt6BRN4I1yMPsF2CjGrhxsGysMtYcOX+YURQl82BYYVvRM8KlypQFlfTIrt1FhFt0PQ+ rOV25iZPt8t5o9ptEP/Ck76tDoL3Oov3A+DldqeuoOSs+FLX5Ie0qb+NcX7vp7BJJSO4 vFoqB3vcPaBp6oLY/PWtuqX3Zuf1rwnZw72nU6SxOC3JY9l47eSDrHOteZBdJ3QeDY72 oefpv+EZ3kIJU7+kDj312YIxUpBpzVLJ2SzL4Ud8mx6iXHniP9U7cqcB9G6bxeunxR1w ojjw== X-Gm-Message-State: AOAM530K74HipU8Y7cbPc1/ABnaHuLZEGoajHHA6P0jDz9GMWmiBCdkS 6IM1EBUOr3YXhRG89NdYaAqwlw== X-Received: by 2002:a63:c:: with SMTP id 12mr16453074pga.477.1635206470644; Mon, 25 Oct 2021 17:01:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:10 -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, Tomas Winkler , Arnd Bergmann , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 28/34] mei: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:38 -0700 Message-Id: <20211026000044.885195-29-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: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/misc/mei/hdcp/mei_hdcp.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c index ec2a4fce8581..79dcc02277d2 100644 --- a/drivers/misc/mei/hdcp/mei_hdcp.c +++ b/drivers/misc/mei/hdcp/mei_hdcp.c @@ -732,8 +732,9 @@ static const struct i915_hdcp_component_ops mei_hdcp_ops = { .close_hdcp_session = mei_hdcp_close_session, }; -static int mei_component_master_bind(struct device *dev) +static int mei_component_master_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct mei_cl_device *cldev = to_mei_cl_device(dev); struct i915_hdcp_comp_master *comp_master = mei_cldev_get_drvdata(cldev); @@ -749,8 +750,9 @@ static int mei_component_master_bind(struct device *dev) return 0; } -static void mei_component_master_unbind(struct device *dev) +static void mei_component_master_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct mei_cl_device *cldev = to_mei_cl_device(dev); struct i915_hdcp_comp_master *comp_master = mei_cldev_get_drvdata(cldev); @@ -759,9 +761,13 @@ static void mei_component_master_unbind(struct device *dev) component_unbind_all(dev, comp_master); } -static const struct component_master_ops mei_component_master_ops = { - .bind = mei_component_master_bind, - .unbind = mei_component_master_unbind, +static struct aggregate_driver mei_aggregate_driver = { + .probe = mei_component_master_bind, + .remove = mei_component_master_unbind, + .driver = { + .name = "mei_agg", + .owner = THIS_MODULE, + }, }; /** @@ -826,9 +832,7 @@ static int mei_hdcp_probe(struct mei_cl_device *cldev, } mei_cldev_set_drvdata(cldev, comp_master); - ret = component_master_add_with_match(&cldev->dev, - &mei_component_master_ops, - master_match); + ret = component_aggregate_register(&cldev->dev, &mei_aggregate_driver, master_match); if (ret < 0) { dev_err(&cldev->dev, "Master comp add failed %d\n", ret); goto err_exit; @@ -850,7 +854,7 @@ static void mei_hdcp_remove(struct mei_cl_device *cldev) mei_cldev_get_drvdata(cldev); int ret; - component_master_del(&cldev->dev, &mei_component_master_ops); + component_aggregate_unregister(&cldev->dev, &mei_aggregate_driver); kfree(comp_master); mei_cldev_set_drvdata(cldev, NULL); -- https://chromeos.dev