From nobody Wed Dec 17 07:29:18 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A635C4167B for ; Wed, 29 Nov 2023 16:37:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231177AbjK2Qht (ORCPT ); Wed, 29 Nov 2023 11:37:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230406AbjK2Qhh (ORCPT ); Wed, 29 Nov 2023 11:37:37 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4154D5E for ; Wed, 29 Nov 2023 08:37:43 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D4108C000C; Wed, 29 Nov 2023 16:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701275862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c/YNgCWPKxHY49wBO0+94oHV863lvdF8QP5nwMeh4Ks=; b=Swke5rHgsw9rKPOlVP+ptkMkixWITnj2HDGZCjEC5/PJ0IolndzKGQiWwkuHoEx4KDbNDL VlzAsgWoxZMvvGR/H7RmJBoJhq+jxS70svG1+axlRz3WXbNZEwwiUa4PsxoEVTVBTV3EUl P6laxC9jKEy8Uh4NKf4XsQWYeFOEuIR2zye/MBALTgQLiVN5L0fuhzal4gn1QL6mHtAith wXdA6VNibGkVgMcmUKIvlJebJamwBdHsp3wSACOh3CGjxthrv0wyDuiwje2/4Dx7y7uH3B N6BTK0yoqcFDYupaVHm/wF/AQqZeIf2U5PfA4lFPlMiM4S35fW5BFrpYJxtuIg== From: Miquel Raynal To: Srinivas Kandagatla , Greg Kroah-Hartman , Cc: Thomas Petazzoni , Robert Marko , Luca Ceresoli , Michael Walle , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Marco Felsch , Randy Dunlap , Chen-Yu Tsai , Daniel Golle , Miquel Raynal Subject: [PATCH v14 4/8] nvmem: Simplify the ->add_cells() hook Date: Wed, 29 Nov 2023 17:37:33 +0100 Message-Id: <20231129163737.698317-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129163737.698317-1-miquel.raynal@bootlin.com> References: <20231129163737.698317-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The layout entry is not used and will anyway be made useless by the new layout bus infrastructure coming next, so drop it. While at it, clarify the kdoc entry. Signed-off-by: Miquel Raynal --- drivers/nvmem/core.c | 2 +- drivers/nvmem/layouts/onie-tlv.c | 3 +-- drivers/nvmem/layouts/sl28vpd.c | 3 +-- include/linux/nvmem-provider.h | 8 +++----- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index b5e5ce67398f..f63db5e01fca 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -816,7 +816,7 @@ static int nvmem_add_cells_from_layout(struct nvmem_dev= ice *nvmem) int ret; =20 if (layout && layout->add_cells) { - ret =3D layout->add_cells(&nvmem->dev, nvmem, layout); + ret =3D layout->add_cells(&nvmem->dev, nvmem); if (ret) return ret; } diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-= tlv.c index 59fc87ccfcff..defd42d4375c 100644 --- a/drivers/nvmem/layouts/onie-tlv.c +++ b/drivers/nvmem/layouts/onie-tlv.c @@ -182,8 +182,7 @@ static bool onie_tlv_crc_is_valid(struct device *dev, s= ize_t table_len, u8 *tabl return true; } =20 -static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *n= vmem, - struct nvmem_layout *layout) +static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *n= vmem) { struct onie_tlv_hdr hdr; size_t table_len, data_len, hdr_len; diff --git a/drivers/nvmem/layouts/sl28vpd.c b/drivers/nvmem/layouts/sl28vp= d.c index 05671371f631..26c7cf21b523 100644 --- a/drivers/nvmem/layouts/sl28vpd.c +++ b/drivers/nvmem/layouts/sl28vpd.c @@ -80,8 +80,7 @@ static int sl28vpd_v1_check_crc(struct device *dev, struc= t nvmem_device *nvmem) return 0; } =20 -static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvme= m, - struct nvmem_layout *layout) +static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvme= m) { const struct nvmem_cell_info *pinfo; struct nvmem_cell_info info =3D {0}; diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index e5de21516387..3939991b3c5f 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -156,9 +156,8 @@ struct nvmem_cell_table { * * @name: Layout name. * @of_match_table: Open firmware match table. - * @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(). + * @add_cells: Called to populate the layout using + * 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. @@ -172,8 +171,7 @@ struct nvmem_cell_table { struct nvmem_layout { const char *name; const struct of_device_id *of_match_table; - int (*add_cells)(struct device *dev, struct nvmem_device *nvmem, - struct nvmem_layout *layout); + int (*add_cells)(struct device *dev, struct nvmem_device *nvmem); void (*fixup_cell_info)(struct nvmem_device *nvmem, struct nvmem_layout *layout, struct nvmem_cell_info *cell); --=20 2.34.1