Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp662560pxb; Wed, 6 Oct 2021 12:41:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOHQKxCAak6WIulmbrdcNa5Knf1eq0ZiyEhzHHIrckHj8jtJnJiI4fI0Ntin/oKXkKaIWa X-Received: by 2002:a63:535f:: with SMTP id t31mr475682pgl.270.1633549274915; Wed, 06 Oct 2021 12:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633549274; cv=none; d=google.com; s=arc-20160816; b=QpSXt62KnDeiP464EpwD1u3D62FKoXLS/8itg/b4uO4MwGVsbD8+/2tbpPG4+sdEO/ Vu7TX8m63OZyruJFp6HOcKXvKe5g5Jdvzg94XqS6jk9iA2p4uS9ArrepJTPlCBe4YpJ4 YyNOXWeBJ5hOidkFVUJZDuwhIE4mcvx5TnrLlbqYwPnn7/TDX0qQVppEbjfMlh9KBvjs 7gPcwPGslxRlXMdYGDo6jx2Xl5yBJK3JHpxuhhY3QEoFaQsprvQFHgeXZTxXAFm5xg89 2Iw2uuBrOx9ynJAgS0ROllLU2g/laczUFiMDJ1ZusJdib6qfLmQYB6iV9Ohu2Pp84uFX MEHw== 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=tc2/5S7bC1vViql9MZNHRkXPWLwgRYYZOClAHQAbVyxa/JjvmMAVsiOC9Orctf8UZ3 GpLbVxgbpeP/YQu9Dsb4PO9cU7tp0Leh+MzhnCTI0HhLk/0U7jJUhV5gGtmeMbKxDUHy nNZ7w61pC8bJZ7taRTOR1UFKKAYqR1qT5WjMKslCCiGY0ktYS1GlfAgJOihhQvRDqhzi ioRkE3pdo20leNYPbB5Ud9/dE7yez8xvgLgDIFmSPOPV52Gsq81J9vXYgadlvKBsJ5sc n7QYwOyPgkW5Sv6p1KoSmtvNP2xJQ2CeJTY95HJrhoN2r1AVaaq8GMQmx4TRs2PgpoeK 7ZaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LjCBQ+Ol; 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 q24si13122481plr.194.2021.10.06.12.41.02; Wed, 06 Oct 2021 12:41:14 -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=LjCBQ+Ol; 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 S239668AbhJFTlz (ORCPT + 99 others); Wed, 6 Oct 2021 15:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239681AbhJFTlJ (ORCPT ); Wed, 6 Oct 2021 15:41:09 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DB73C061768 for ; Wed, 6 Oct 2021 12:38:55 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id i65so322813pfe.12 for ; Wed, 06 Oct 2021 12:38:55 -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=LjCBQ+OlDWXcZsNZnBQtgm7AMig+37EhFW/9+yCcAfo48unx4nzdWSchzmgePmUhjA XyCY7hFDWvvn/+KhoHPX2V7JR+YVar3L1AffYvxYFJsLh905j5B2OD38wqtDboraJ85U 3QKnCZtLlfUM6fZHBa+mf8XZ+uBlsfEQEyFQY= 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=ypinHvFAqboVeIcYf2FhwNfZZ58d8kg57dkcwdFTPNiA8OfQdYBQluA9RnspcsgkFa wYfPLZ0qy6Bdm3wfFBYhP5Haoy+4qOG+MrsxP8j8dRWSbvPmd4ofeJccsz5PJNg4t8sl mguzKlIMarndPn8RJFS78tg7fjRRfVY7Pp3IeFqmbnl9elk0gWh6d9CGgXcfk0uXp+5x J/3OpYGkFbtMqrrOA4sHv1IPYSGWArT41x1SlqZVQMwJn8HgdfVUQjxTVagAr6Zk9fh1 xicLsmhnxhPlk02LokIoTJCcRtSH8zMh9A/lxx8U08iwKDVShwjZBIzzY/y1qNdMd/fc Q9YA== X-Gm-Message-State: AOAM530k/5McgXP1CSL7IBov+d6qtEiq5j5pZf8bna/pro0Y68v6eZE5 5OpCcRzXX0dK93ck2bgssa+1kg== X-Received: by 2002:a62:403:0:b0:433:9582:d449 with SMTP id 3-20020a620403000000b004339582d449mr178657pfe.15.1633549134744; Wed, 06 Oct 2021 12:38:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 12:38: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, Tomas Winkler , Arnd Bergmann , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v2 27/34] mei: Migrate to aggregate driver Date: Wed, 6 Oct 2021 12:38:12 -0700 Message-Id: <20211006193819.2654854-28-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: 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