Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp712677rdg; Wed, 11 Oct 2023 03:33:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEJKSBjunMhD/KxsROBpnzCG+i41e1XoDYcxmp/Wz9QGyChmNDpkZN0tXwVftn76kT5/yi X-Received: by 2002:a17:90a:b008:b0:273:cb91:c74f with SMTP id x8-20020a17090ab00800b00273cb91c74fmr20933352pjq.8.1697020437039; Wed, 11 Oct 2023 03:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697020437; cv=none; d=google.com; s=arc-20160816; b=vkPCrx8oGrlOIP1TySEyx0rZA4g8j1Yq+wo63rHVrjCzHmnuanUqhb6dpJS6MWbHtK NKGoWBBF9ru3kfuBLqcplA7hCF8dxe14yBEacgv9fhZFyJVnxlQNmKbhb0CJO9cva3Es l/IMeWZP/TnlaYjDsXNm7hzRBb9cBuu3nyU94Og6u/jgapMByZeGKDwpAFd4x9Rdp+ge gfsAW2pprLYUl2lRvoM217ILhkE/vZU6A78aAHxk3esmTd20x0aC+zoXscX5y5pdsg8r uMaR+ljUSsOux9KbFUiN9scng3DVSXEGdK9c87havvWiQsPwMsP/Td4EA1xZIgMf9Ouq pQjA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=NMc547evd8LnPOnBrC1MZnEbM8rxfz9r+nKmvxJ3r0A=; fh=2Wpx5CIoSKpW/Nj8XVjaQ8ZKBh9Qf1XjU2Psxa0hFT8=; b=MAsxitXLEHYyE0ryAomtT8mIuo3D5tsNBV2jGjgPvxU328XJMHM7juglHLIQZsq+tj kB54NUY60jw1On/dHO28fRaxPaROyn2Lzk/blS2dUy37Exf8eJ7vrJ0Arr/vptqhugNH bTNipBCIAxLCiyw3qAQMmB8ybnm16eIWCpjnSoI6kRY6Tq4BdUcFSmMFsOVtICoINSGA Ow3h/lmM3IqjCdi301wtP9TwITymOoBwWS3ZGtxw37QXo2b5Iiz3FAsP+U1n+/vASXBF /467gZqc4VG1B/CdHfEEBu+u3aI5s5FdihHfLyGfFcWlNmgxmwERjge2m8LvMeWkoYP3 q6mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Vc516wah; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id co11-20020a17090afe8b00b002790fa91d77si15864572pjb.145.2023.10.11.03.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Vc516wah; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 884608075972; Wed, 11 Oct 2023 03:33:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346236AbjJKKdo (ORCPT + 99 others); Wed, 11 Oct 2023 06:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346017AbjJKKdn (ORCPT ); Wed, 11 Oct 2023 06:33:43 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8109792; Wed, 11 Oct 2023 03:33:41 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id A99F640008; Wed, 11 Oct 2023 10:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697020419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NMc547evd8LnPOnBrC1MZnEbM8rxfz9r+nKmvxJ3r0A=; b=Vc516wahyW3fDn24P8bi9r4qgErjJHSAlpqt9hnK7cyEcYOHkwJbpuCU1WPr6Zfwey6OxA /lzTHvErIZVPhZYFwfs+pq15ZELjfFKg7Wm+D92iVgmGRPSjgewpaI8PaaJ/+IpQgXpJRy L7pJffgWm+4QzHDPek5KHM+vqbXswVH5vnHU/csEVwD69kdj+GNqeUB8TODvq9lEdYNgKW ttBuj6gfKJREauxhxB9BjEHtflhlzvzSg3K9WuvxXei9jIraph4GeIOfrfLka7H/Rg/Wrt 3hwF2pFJXjnA93xnZLPuGjJKUW8qNF5c2wySkBuaGxmjAZt8OLRTcfpDn3vpdg== Date: Wed, 11 Oct 2023 12:33:36 +0200 From: Miquel Raynal To: Greg Kroah-Hartman Cc: Srinivas Kandagatla , Michael Walle , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Marko , Thomas Petazzoni , Luka Perkov , Randy Dunlap , Chen-Yu Tsai , Daniel Golle Subject: Re: [PATCH v12 5/7] nvmem: core: Rework layouts to become regular devices Message-ID: <20231011123336.642881b8@xps-13> In-Reply-To: <2023100722-stallion-unquote-a3b1@gregkh> References: <20231005155907.2701706-1-miquel.raynal@bootlin.com> <20231005155907.2701706-6-miquel.raynal@bootlin.com> <2023100722-stallion-unquote-a3b1@gregkh> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 03:33:54 -0700 (PDT) X-Spam-Level: ** Hi Greg, gregkh@linuxfoundation.org wrote on Sat, 7 Oct 2023 18:31:00 +0200: > On Thu, Oct 05, 2023 at 05:59:05PM +0200, Miquel Raynal wrote: > > --- a/drivers/nvmem/internals.h > > +++ b/drivers/nvmem/internals.h > > @@ -28,8 +28,30 @@ struct nvmem_device { > > nvmem_reg_read_t reg_read; > > nvmem_reg_write_t reg_write; > > struct gpio_desc *wp_gpio; > > + struct device *layout_dev; > > struct nvmem_layout *layout; > > void *priv; > > }; =20 >=20 > Wait, is this now 2 struct device in the same structure? Which one is > the "real" owner of this structure? Why is a pointer to layout_dev > needed here as a "struct device" and not a real "struct > nvmem_layout_device" or whatever it's called? >=20 > > struct nvmem_layout { > > - const char *name; > > - const struct of_device_id *of_match_table; > > + struct device *dev; =20 >=20 > Shouldn't this be a "real" struct device and not just a pointer? If > not, what does this point to? Who owns the reference to it? Good point, I've initially tried to create the simplest possible bus, but you're right it will be nicer if the layout device structure carries the 'struct device'. I've added a bit of infrstracture but it looks better, thanks for the suggestion. Thanks, Miqu=C3=A8l