Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp757349pxb; Fri, 28 Jan 2022 09:18:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyliJxv6gzxbidGKlzKuPdE3i4HFwjyM7W/k69a9PwXxNDki7/mKZwcQo5f8Ke4gUnUpyap X-Received: by 2002:a17:902:f253:: with SMTP id j19mr8690045plc.24.1643390315279; Fri, 28 Jan 2022 09:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643390315; cv=none; d=google.com; s=arc-20160816; b=ZTdMQ+Yx3YsZRWymgboaYxt10kfg1UCKPvH1I7W1C8MTde1mxefH9kS+rTQF/DzONC wObZv+JhWPV9yorRY5Vt2IxhgkJinkEDEIXLoKCc0+Ke7HxWKbK3wh7vVIeTKF/7tbQL soEwmRJuEHcezpFgTJFOG+JJEdHgKE0gWU2bhUAJjmbOYGmYha0+Vtp5jalMFDA6Of0k WO6TfZRKhIJfqko8CLNGPp0y+Q2yzzwJX+tby7u2uShYGRfrZU+nIbLZhbucfToalGV5 zjpHUxL799fRTD3DgidjHQtVLV1H317e2fwJ6fsfYseJNlUig6tsMaPRYWXafF8KWwNS mefQ== 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=mlOjEQaGgQJEWexKeIDPB6ZywfuO0Krhl/6WTCAgp1U=; b=JpLcIXLhO9TFDksIXHWTBwZ2ByqTZ/6fkxgOplhQh734VvyxmBbhB4gBMndHdy1WnX 7bXUTSRDg+rbeQu3F6ha2Qq00u5n0VLue1MFgM/XEbdvf8YFQvgLLxoXqyNp15cp99QS UqRDcjPLuLnZh/onrCZkmaXaRx10pK0sK6e/HKCJO7h+io94EeSDbSyF9MI29NBFUHHJ 6xxhmc7ptCL42LPKzjTLnmXRK8OVAV3+eQQuoFCp8SgoDMYkbadtMARmt4l6JpiKTZwK PyVV6QLypRMiKP82uhpXsps8KtkV0ywfLKsB/XRANGBvYRiYzjy8WbGtiLDYNml3aTBF 12hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eyrrZkbz; 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 f8si6284982plg.281.2022.01.28.09.18.23; Fri, 28 Jan 2022 09:18:35 -0800 (PST) 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=eyrrZkbz; 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 S1343641AbiA0UCB (ORCPT + 99 others); Thu, 27 Jan 2022 15:02:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343622AbiA0UB6 (ORCPT ); Thu, 27 Jan 2022 15:01:58 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6031EC061714 for ; Thu, 27 Jan 2022 12:01:58 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id j16so3702986plx.4 for ; Thu, 27 Jan 2022 12:01:58 -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=mlOjEQaGgQJEWexKeIDPB6ZywfuO0Krhl/6WTCAgp1U=; b=eyrrZkbzPEVq72Z6fNYVKdNXOMuVYUB7XGcmAelArR/eBBTm4qv34sUVGHRw2+3Xjb qxYlvdBkbnSilPXGvWPCeiDXV+5AgRyZ6rpwDbyu6pszvNmM2d966CHxA1CXRr6njd4o N75g5GBD63J2h2qcjJmsi51wKmNMAMIts0FjU= 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=mlOjEQaGgQJEWexKeIDPB6ZywfuO0Krhl/6WTCAgp1U=; b=CfZUghf71Gxzmx9HZXWtcICX/uod69NPP5lHxJZNJFoh9rfOrTjNszksQxJ45pNy4e zzKVg+QitzwMwhEZBmu7T0OC4+RcZKiuXSX1uCbotWELyfdrI7BakRoIIGHZKYHsA231 BovWc4N2CcOKw91NA36ZhzaFXvNOPIn95F5L3agYhdcrqpC8AXNePzADSkhornqfyCrH 5WSsBF/txfdSTqv1X1Mm2oxYMEIqhQ7Uynu+WhwqdAk1NUstlQmgKGgvLQ2tTcQ1ZJui VNRZsBrqPmrqoae9VMY9CQm6/0ql46OFDX2uos6I7nKi28mYPprP/p+VIOUEf3At0xXn PX4w== X-Gm-Message-State: AOAM530oFX5P8di7pkMVTLxv/Zw6P+aRTAxb1UTPBNOtJFwHTfIPXiYw biJbYovLbeeRKjd0wcblAe1hxQ== X-Received: by 2002:a17:902:f68e:: with SMTP id l14mr4800119plg.164.1643313717953; Thu, 27 Jan 2022 12:01:57 -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.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 12:01:57 -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, Jani Nikula , Daniel Vetter , Laurent Pinchart , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v6 03/35] component: Add aggregate_device_parent() for driver use Date: Thu, 27 Jan 2022 12:01:09 -0800 Message-Id: <20220127200141.1295328-4-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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This allows aggregate driver writers to get the parent of the aggregate device passed to their probe/remove/shutdown functions. Suggested-by: Jani Nikula 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 | 6 ++++++ include/linux/component.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/base/component.c b/drivers/base/component.c index dc748ef0b23b..13ac2004a913 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -71,6 +71,12 @@ static inline struct aggregate_device *to_aggregate_device(struct device *d) return container_of(d, struct aggregate_device, dev); } +struct device *aggregate_device_parent(const struct aggregate_device *adev) +{ + return adev->parent; +} +EXPORT_SYMBOL_GPL(aggregate_device_parent); + struct component { struct list_head node; struct aggregate_device *adev; diff --git a/include/linux/component.h b/include/linux/component.h index aa69ea0401d3..c39dea7824af 100644 --- a/include/linux/component.h +++ b/include/linux/component.h @@ -43,6 +43,7 @@ int component_bind_all(struct device *parent, void *data); void component_unbind_all(struct device *parent, void *data); struct aggregate_device; +struct device *aggregate_device_parent(const struct aggregate_device *adev); /** * struct component_master_ops - callback for the aggregate driver -- https://chromeos.dev