Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp928153pxb; Mon, 25 Oct 2021 22:42:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/A+TKgH7n5z9CvZBA+ZE6b9rXqrERe1GyzCEt9b9SVdNsjDRdQ/K1dt9NjEScx1z98lDu X-Received: by 2002:a17:90b:3910:: with SMTP id ob16mr26313311pjb.234.1635226966462; Mon, 25 Oct 2021 22:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635226966; cv=none; d=google.com; s=arc-20160816; b=UkunpVn6bivAfq5EhEVHDNePwj+fG5zJDNsjlV4604z13+2G/UfCSm1cfjxMIac/6E t1F8g8+KyeoUefwPwtMWqzQmFq8870kzyiXpMAY7vjNoefkFDpOaqSDgfvxVK5VnqCp9 GxJzJSjd6RZIbG3NSF93xP+kAO8f1WRBQoRd0Bl1iJuv8YQ3XVyZo0qHRRuAiObBldQ4 mxSe0+004rH8hXwJPzc7J/xRD2Byju0S4JPASBhDibz8tJaIQxkY4wQRFq6xPqpjsKsK RZd1Uh9Q8ax1eRPLayLhikfghhKic66qVTHP0ImDf93uSo9aSmECl+aPqH67bniMcNMU EgJQ== 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=0msA0xs8lhZ+Yu7wuGuAFKr0B67vxNoH5+pgXRqbiBg=; b=gZ2utHnDuDwTHLBpY8OKnk7JNcKH07Ohl8ucsfT3N9ykJulSm4R1O2xRH//cJb/ap4 ouo3OLZ3cN0KO5PLfVXsOg+dPddl7fR3uDQyUVDBXp/Ccc4zGTnf/zFdFdLjUMEO8spl C3Sp+/S5jWlxcWSgUOYKU+3UWzPmuVRA54j6ozo0Fc96ljEzqNHapDEat5ZAl5vZiFvj S1+BacjrKRq6cYeHYt8EwOXvPA9ZLPF5uA6fMmd8z7GNJg6M2B0p4she7g7ccJ4rAIFl geaF3FZKMQLYkC1ASMBxtn5tPgCrAfvLBplvKZORtmH/fLav5icX1jX/MUr1ZbFeq1rs lvEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fINIymHE; 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 hg18si12130049pjb.150.2021.10.25.22.42.34; Mon, 25 Oct 2021 22:42:46 -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=fINIymHE; 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 S235502AbhJZADb (ORCPT + 99 others); Mon, 25 Oct 2021 20:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235506AbhJZADN (ORCPT ); Mon, 25 Oct 2021 20:03:13 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE05CC061220 for ; Mon, 25 Oct 2021 17:00:50 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 75so12301547pga.3 for ; Mon, 25 Oct 2021 17:00:50 -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=0msA0xs8lhZ+Yu7wuGuAFKr0B67vxNoH5+pgXRqbiBg=; b=fINIymHE/3VXwQ4Cv4u1C8mWtt0WD7C3a+GM+AqVyvsqSuzRyN05Ov13w93KcIJ7YC uGfRG9WMH6ZmoC65whT9OOrVWakix/A3gm95LjHyVCeUQy6Bx/yGc6+TJwkSsF0zbtdp n/lFvtAUzzyUf1tY0ikLKeweCG2gHITgrOa/Q= 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=0msA0xs8lhZ+Yu7wuGuAFKr0B67vxNoH5+pgXRqbiBg=; b=qDqDdS9CgSwlvI9KHBVPsvDruA+6eDrpbchajz4O0AV0KtNiCaWU3DkULLvE2RX/Qc N9o+/mmUtFij2p/5249nLm4l3tL044SS1n198XhZylY0seDxpqb+EYzAs0sIAbz3qFFm K3xNR06wy/NsE9uq0Fju0tdEbZwXB0tdN2Ed/KWzza3vxRdjPORNdEcMAAEjHFQGKQqT nCXnRi2iXevjrpzYeoWee8ZMDUpJfFPk/kREC4ajcl8UY9WIn754iWtV47zOHrrlhwEv yOIH7zqQDDBVVLIP9Bm4BjG+LDIRTKna/f6FHu4qr+DQZpAjx0X92RGkBg7q0O/2x/Qr MzGg== X-Gm-Message-State: AOAM5335OGARlBfqBvVKoJsMJvKtILXwSTgenBDxlU8JfBcXpPuT3sD3 TqQJN025CDqavuhRkosCHBgYXA== X-Received: by 2002:a05:6a00:198b:b0:47b:ac2d:68f4 with SMTP id d11-20020a056a00198b00b0047bac2d68f4mr21337865pfl.1.1635206450134; Mon, 25 Oct 2021 17:00:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:00:49 -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, Daniel Vetter , Laurent Pinchart , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 04/34] component: Move struct aggregate_device out to header file Date: Mon, 25 Oct 2021 17:00:14 -0700 Message-Id: <20211026000044.885195-5-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 This allows aggregate driver writers to use the device passed to their probe/remove/shutdown functions properly instead of treating it as an opaque pointer. Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Laurent Pinchart Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/base/component.c | 15 --------------- include/linux/component.h | 19 ++++++++++++++++--- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index 3d9d2f94df28..997b17053ecf 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -57,21 +57,6 @@ struct component_match { struct component_match_array *compare; }; -struct aggregate_device { - const struct component_master_ops *ops; - struct device *parent; - struct device dev; - struct component_match *match; - struct aggregate_driver *adrv; - - int id; -}; - -static inline struct aggregate_device *to_aggregate_device(struct device *d) -{ - return container_of(d, struct aggregate_device, dev); -} - struct component { struct list_head node; struct aggregate_device *adev; diff --git a/include/linux/component.h b/include/linux/component.h index 95d1b23ede8a..e99cf8e910f0 100644 --- a/include/linux/component.h +++ b/include/linux/component.h @@ -5,6 +5,8 @@ #include #include +struct component_match; + /** * struct component_ops - callbacks for component drivers * @@ -39,8 +41,6 @@ void component_del(struct device *, const struct component_ops *); int component_bind_all(struct device *master, void *master_data); void component_unbind_all(struct device *master, void *master_data); -struct aggregate_device; - /** * struct component_master_ops - callback for the aggregate driver * @@ -80,7 +80,20 @@ struct component_master_ops { void (*unbind)(struct device *master); }; -struct component_match; +struct aggregate_device { + const struct component_master_ops *ops; + struct device *parent; + struct device dev; + struct component_match *match; + struct aggregate_driver *adrv; + + int id; +}; + +static inline struct aggregate_device *to_aggregate_device(struct device *d) +{ + return container_of(d, struct aggregate_device, dev); +} /** * struct aggregate_driver - Aggregate driver (made up of other drivers) -- https://chromeos.dev