Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4712872rdh; Wed, 29 Nov 2023 08:38:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJUMeLBps89+BS4zXH0xBGjRugEWz8AARYXr5IwLlwDYtplt74ju0S3j0ktc/FI2EvkoOa X-Received: by 2002:a17:903:643:b0:1cf:6453:b23a with SMTP id kh3-20020a170903064300b001cf6453b23amr15092162plb.53.1701275883143; Wed, 29 Nov 2023 08:38:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701275883; cv=none; d=google.com; s=arc-20160816; b=SqUK/JTH3QhPLQJ2uBMRJb3Oe+AIBPpdgxc+A2JLddH7zGTD6UzNkV08r8SltuLUfu s43NuCLyPCQiVjoHnokwd6e2VFukbkzGKqbsqooO7KI60c7JX6pWyb6R0lQ5UULTsiTp JyvLSgDZhWn8CAKCWM+rTlXmOMsZ1VucYKoAsyvfyEP08BYWElyjQ3vScKfOUSTwQvHU 3hRQqjm51Mna4qzGiogb+auQtDFxLy/R3lcPSsaWK6xUV8ZtQWxsXMiG/gsGKLzpNVvk CNlQQNKBZ6ZLKbR3ltG2tOKeR962Sv868gG7D0wRmCwabD0QbM8Uy5WTWIGMeJ+S3Dg9 NMdw== 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=c/YNgCWPKxHY49wBO0+94oHV863lvdF8QP5nwMeh4Ks=; fh=LHVfHqkxtSfhDK3Auz+HtR9CGNiwZCQHjp1a868hmsY=; b=0U1FU6S+wlswLHQtKpXs+UV6bKXMvJHe625/+UnFCqwBH476ktcXW5kX6abxlMJTmT 30r5c0tQe/vjt/ErzLxGiKZBHYEOeRVOZnAKgWyC9R/zIb1lkT18cmoy85bANjGJ02dT EwTlA+FI4M/8KbMECVuRX+XkXYeakUEhB/GEwalvehwpUQzLtjbuNK/T2YMQZ2poQ0LU 4XkoI6RlzRjvkqvrbCB0i55aHrSpVcvA01p2916iZBqH1XV1lpi+QKaLczYZ4TlvMIW1 uESKt9vfmR7vJWc8C0s589+DOLBTcyd3sUi4HVEnUt61srjEYSD/FdISRP+iDKujGlLh oMZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Swke5rHg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a17-20020a170902b59100b001cc2ef72ab2si13796034pls.68.2023.11.29.08.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 08:38:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Swke5rHg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 20DBB802F860; Wed, 29 Nov 2023 08:38:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbjK2Qhr (ORCPT + 99 others); Wed, 29 Nov 2023 11:37:47 -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: 8bit X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 08:38:02 -0800 (PST) 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_device *nvmem) int ret; if (layout && layout->add_cells) { - ret = layout->add_cells(&nvmem->dev, nvmem, layout); + ret = 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, size_t table_len, u8 *tabl return true; } -static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem, - struct nvmem_layout *layout) +static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem) { 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/sl28vpd.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, struct nvmem_device *nvmem) return 0; } -static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvmem, - struct nvmem_layout *layout) +static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvmem) { const struct nvmem_cell_info *pinfo; struct nvmem_cell_info info = {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); -- 2.34.1