From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E08A8C433F5 for ; Tue, 21 Dec 2021 09:30:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD29F10F459; Tue, 21 Dec 2021 09:30:07 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41CA710F453; Tue, 21 Dec 2021 09:30:06 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E32C3B81217; Tue, 21 Dec 2021 09:30:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27FBBC36AE2; Tue, 21 Dec 2021 09:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1640079001; bh=t9uG/PUzJfJCt5vq7qOvzQiuQHsRYBb+5hBgWJjQF8c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MMrMbGrsqXDDJawxnYTgl5OlqV29ks8dDbYtGt+9DN7vpqfD5awhcaVrfIphjkLhR eCRBU9SysvivSe0EOauQNT2dECjbHZrp5OFoLLZrHfj5oxihlfsbp1jTAEj+M4zMa2 qN4tkQlXtDx9JJihAZOgHkEn4Qjac7ihVzHqkY94= Date: Tue, 21 Dec 2021 10:29:59 +0100 From: Greg Kroah-Hartman To: Stephen Boyd Subject: Re: [PATCH v4 01/34] component: Introduce struct aggregate_device Message-ID: References: <20211202222732.2453851-1-swboyd@chromium.org> <20211202222732.2453851-2-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211202222732.2453851-2-swboyd@chromium.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Saravana Kannan , "Rafael J. Wysocki" , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Laurent Pinchart , Daniel Vetter , Russell King , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Dec 02, 2021 at 02:26:59PM -0800, Stephen Boyd wrote: > Replace 'struct master' with 'struct aggregate_device' and then rename > 'master' to 'adev' everywhere in the code. While we're here, put a > struct device inside the aggregate device so that we can register it > with a bus_type in the next patch. > > The diff is large but that's because this is mostly a rename, where > sometimes 'master' is replaced with 'adev' and other times it is > replaced with 'parent' to indicate that the struct device that was being > used is actually the parent of the aggregate device and driver. > > 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 | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/base/component.c b/drivers/base/component.c > index 2d25a6416587..d25048d04b70 100644 > --- a/drivers/base/component.c > +++ b/drivers/base/component.c > @@ -9,6 +9,7 @@ > */ > #include > #include > +#include > #include > #include > #include > @@ -63,7 +64,10 @@ struct master { > > const struct component_master_ops *ops; > struct device *parent; > + struct device dev; Who initializes this new structure? > struct component_match *match; > + > + int id; > }; > > struct component { > @@ -79,6 +83,7 @@ struct component { > static DEFINE_MUTEX(component_mutex); > static LIST_HEAD(component_list); > static LIST_HEAD(masters); > +static DEFINE_IDA(aggregate_ida); > > #ifdef CONFIG_DEBUG_FS > > @@ -440,6 +445,7 @@ static void free_master(struct master *master) > } > } > > + ida_free(&aggregate_ida, master->id); > kfree(master); > } > > @@ -460,7 +466,7 @@ int component_master_add_with_match(struct device *parent, > struct component_match *match) > { > struct master *master; > - int ret; > + int ret, id; > > /* Reallocate the match array for its true size */ > ret = component_match_realloc(match, match->num); > @@ -471,9 +477,17 @@ int component_master_add_with_match(struct device *parent, > if (!master) > return -ENOMEM; > > + id = ida_alloc(&aggregate_ida, GFP_KERNEL); > + if (id < 0) { > + kfree(master); > + return id; > + } > + > + master->id = id; > master->parent = parent; > master->ops = ops; > master->match = match; > + dev_set_name(&master->dev, "aggregate%d", id); You set the name yet the device is not "real"? I don't understand this patch at all, sorry. greg k-h