Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1392977rdh; Fri, 24 Nov 2023 11:22:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IH914BLkWauMfMGry37QGdLVmi3X10tRc4A9hOPHoEWrqAO4408I4Yih120zuiUXPOUFwft X-Received: by 2002:a05:6808:1898:b0:3b2:d8c8:7bfa with SMTP id bi24-20020a056808189800b003b2d8c87bfamr5268881oib.8.1700853725450; Fri, 24 Nov 2023 11:22:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700853725; cv=none; d=google.com; s=arc-20160816; b=NRnx3NOCSdAWM2BsbNc8SRaVBxVAZP/gsrYqfLPYxu+uOHl1Kyig1VlBOrM3TJmZ7u G+pWJa3zwiuJ8kR9n1lETRxfP0oT2ecClml3UYZZYjMhqS4nsH/rddPxcqvL2e+99EO6 Ta4zdFYrlY+3QGK2QlBTuK+qSdjEW8c7PziZj9BdsdejeAlbB3L8v5L6WkdIxnVhuKuU nRVPQnlFxyz8MbQ1CMLxtMRvRDoIY1BxhrZ+w+cCZtiVVFymOgu7gMomMwiGU1sxsESQ 6hNi1uD+Ju4pGudGtRS7nHjAstpnCVM5chR2dLJkMe7YGWau8X0lfut+TsDEh1ZwHrSA 8eJg== 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=J3b2pUDzwJvMft0yFcqw8+TzcFPQg8RIeSoNPyeUUQw=; fh=1eTaNCykFGAU1XoJzUTw9pni7a+FjHeBp8ytN1Uzlj0=; b=SYboT3t6wW/YtGa1mpMKI3bSTNe0+JFIS1r6ygEuOfCoxEhtetZHALxtgoLN4loWin FQXRNqMQoaX1+kblXAlRIiM+cGLZR4kICVVwzBlsbIrIzgLpYb1jp+rZyXmfjmt3FXp7 kYIUO+vRqM7jjdD59/EDe2GgxyVE5uK5kTY7Jpbz8wYtJpde9j5aAet9W/wxZJ6XlaEo J37gLXD+EpTKAoqTRVa9v7Q54tOG2flVhBldDhX99nYYn+cnwpP7ilYYRPtkhzCWUAuO AJSAkVe2dHMGEDgyxeth73BphEVBElQ0eiw1ivEFyZYplrcNqug8dhYzXuz7zdZbH/io ozMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FSPpSIcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id y68-20020a636447000000b005c1b311a152si4148960pgb.657.2023.11.24.11.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 11:22:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FSPpSIcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id C57EC825549C; Fri, 24 Nov 2023 11:21:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345975AbjKXTVi (ORCPT + 99 others); Fri, 24 Nov 2023 14:21:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345799AbjKXTVi (ORCPT ); Fri, 24 Nov 2023 14:21:38 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2AF730F1; Fri, 24 Nov 2023 11:21:43 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C96C91BF204; Fri, 24 Nov 2023 19:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700853702; 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=J3b2pUDzwJvMft0yFcqw8+TzcFPQg8RIeSoNPyeUUQw=; b=FSPpSIcHx5vNnE623heOVHaar2z8E++07I53zby4DPyFLYnF0HTM1e0vopXAdxe3Syw1Kz XjuE+QCCrg3RUqrzgLLh6VoceXRvicQuGQQHEGaA3MzGSP6FeT6BSgl5/4eFtjkxZxB/mi CJMim6psEELHOmoVtL/eKcm9Ox2w4XewjiXWI15G5lfqliNn0NyVHdOAwaBBrNwv6yjXJ1 q0nhm3sSYMwWOz1ezEviZYdTyx6+dEFcMi+EhK6ctSI8qEJWAQ+tpq3DB3iTm+65n+MGW7 qXna+C1l5FVkhGVMYg3NWTjzzh52nRYlzIhpjXZ28pD2xNikZ4SmugRVqgRIPQ== Date: Fri, 24 Nov 2023 20:21:36 +0100 From: Miquel Raynal To: Marco Felsch Cc: Srinivas Kandagatla , Greg Kroah-Hartman , 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 , kernel@pengutronix.de Subject: Re: [PATCH v13 4/6] nvmem: core: Rework layouts to become regular devices Message-ID: <20231124202136.799db18b@xps-13> In-Reply-To: <20231122220240.4jg245vblnh6d5zy@pengutronix.de> References: <20231011111529.86440-1-miquel.raynal@bootlin.com> <20231011111529.86440-5-miquel.raynal@bootlin.com> <20231122220240.4jg245vblnh6d5zy@pengutronix.de> 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=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 24 Nov 2023 11:21:56 -0800 (PST) Hi Marco, m.felsch@pengutronix.de wrote on Wed, 22 Nov 2023 23:02:40 +0100: > Hi Miquel, >=20 > thanks a lot for your effort on this. Please see my comments inline. Thanks for your interesting feedback! I do agree with most of your comments and will correct them for the next version. > > +static int onie_tlv_probe(struct nvmem_layout *layout) > > +{ > > + layout->add_cells =3D onie_tlv_parse_table; =20 >=20 > Nit: the add cells could be done here as well, same for the other > layout. Would save us one indirection. I prefer all the handling of the cells to be done in a generic place like the core. In fact patch 5 adds something to this indirection. ... > > /** > > * struct nvmem_layout - NVMEM layout definitions > > * > > - * @name: Layout name. > > - * @of_match_table: Open firmware match table. > > + * @dev: Device-model layout device. > > + * @nvmem: The underlying NVMEM device > > * @add_cells: Will be called if a nvmem device is found which > > * has this layout. The function will add layout > > * specific cells with nvmem_add_one_cell(). > > * @fixup_cell_info: Will be called before a cell is added. Can be > > * used to modify the nvmem_cell_info. > > - * @owner: Pointer to struct module. > > - * @node: List node. > > * > > * A nvmem device can hold a well defined structure which can just be > > * evaluated during runtime. For example a TLV list, or a list of "nam= e=3Dval" > > @@ -170,17 +169,19 @@ struct nvmem_cell_table { > > * cells. > > */ > > struct nvmem_layout { =20 >=20 > Since this became a device now should we refelct this within the struct > name, e.g. nvmem_layout_dev, nvmem_ldev, nvm_ldev? I'd say it is a matter of taste, in general I don't like much the _dev suffix. We handle nvmem layout drivers and nvmem layouts, like we have joystick drivers and joysticks, I don't feel the need to suffix them. I would not oppose if someone would rename this structure though. > Regards, > Marco >=20 I'm fine with all your other comments and will make my best to address them. Thanks, Miqu=C3=A8l