From nobody Fri Jan 2 15:16:42 2026 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 AF611CD6E5C for ; Wed, 11 Oct 2023 11:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346111AbjJKLPu (ORCPT ); Wed, 11 Oct 2023 07:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345945AbjJKLPj (ORCPT ); Wed, 11 Oct 2023 07:15:39 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F5AA7; Wed, 11 Oct 2023 04:15:37 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id AFF7B1C000D; Wed, 11 Oct 2023 11:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697022936; 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=EWJphzkvsBfSMHYq9wGyiA3n29gzaJOgdTbtajkF/ws=; b=ETQ80/3NCigpiqIOmCoT2N5EM4fH22WgGKFhuBHealajufHyq8NiTpCSG+3rneaoSou6u/ UsxTMwHQTGzZZRs2RTY9lmw4WBBZHmUU5P+z4DFNRW4E2+RSaLGchATp2wN0WuL/CGJE1P qK9Dev0yi10dT/3cWpnLqPui1r7FRbuj/YS+pyFWdB1slsTiAtb0Egl5X0C7IXQ/Sj1jOl UCfY1kVzHcsDCjakgyPqVhBGzP7VUnU8mBl7ll/uYU099eIGzghKzh6vs2B5ER3z/zueGT Ta/Y2ILDKQaEvRplm9B/IVeMQPoxA9uKmG8LxJ+3Qdb2gpWr2YoqrFd3FrSBjQ== From: Miquel Raynal To: Srinivas Kandagatla , Greg Kroah-Hartman Cc: Michael Walle , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, , Robert Marko , Thomas Petazzoni , Luka Perkov , Randy Dunlap , Chen-Yu Tsai , Daniel Golle , Miquel Raynal Subject: [PATCH v13 2/6] nvmem: Move of_nvmem_layout_get_container() in another header Date: Wed, 11 Oct 2023 13:15:25 +0200 Message-Id: <20231011111529.86440-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011111529.86440-1-miquel.raynal@bootlin.com> References: <20231011111529.86440-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" nvmem-consumer.h is included by consumer devices, extracting data from NVMEM devices whereas nvmem-provider.h is included by devices providing NVMEM content. The only users of of_nvmem_layout_get_container() outside of the core are layout drivers, so better move its prototype to nvmem-provider.h. While we do so, we also move the kdoc associated with the function to the header rather than the .c file. Signed-off-by: Miquel Raynal --- drivers/nvmem/core.c | 8 -------- include/linux/nvmem-consumer.h | 7 ------- include/linux/nvmem-provider.h | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index eaf6a3fe8ca6..93b867b3cdf9 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -841,14 +841,6 @@ static int nvmem_add_cells_from_layout(struct nvmem_de= vice *nvmem) } =20 #if IS_ENABLED(CONFIG_OF) -/** - * of_nvmem_layout_get_container() - Get OF node to layout container. - * - * @nvmem: nvmem device. - * - * Return: a node pointer with refcount incremented or NULL if no - * container exists. Use of_node_put() on it when done. - */ struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvm= em) { return of_get_child_by_name(nvmem->dev.of_node, "nvmem-layout"); diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index 4523e4e83319..960728b10a11 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -241,7 +241,6 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node= *np, const char *id); struct nvmem_device *of_nvmem_device_get(struct device_node *np, const char *name); -struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvm= em); #else static inline struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *id) @@ -254,12 +253,6 @@ static inline struct nvmem_device *of_nvmem_device_get= (struct device_node *np, { return ERR_PTR(-EOPNOTSUPP); } - -static inline struct device_node * -of_nvmem_layout_get_container(struct nvmem_device *nvmem) -{ - return NULL; -} #endif /* CONFIG_NVMEM && CONFIG_OF */ =20 #endif /* ifndef _LINUX_NVMEM_CONSUMER_H */ diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index dae26295e6be..2905f9e6fc2a 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -205,6 +205,16 @@ void nvmem_layout_unregister(struct nvmem_layout *layo= ut); const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem, struct nvmem_layout *layout); =20 +/** + * of_nvmem_layout_get_container() - Get OF node of layout container + * + * @nvmem: nvmem device + * + * Return: a node pointer with refcount incremented or NULL if no + * container exists. Use of_node_put() on it when done. + */ +struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvm= em); + #else =20 static inline struct nvmem_device *nvmem_register(const struct nvmem_confi= g *c) @@ -242,6 +252,10 @@ nvmem_layout_get_match_data(struct nvmem_device *nvmem, return NULL; } =20 +static inline struct device_node *of_nvmem_layout_get_container(struct nvm= em_device *nvmem) +{ + return NULL; +} #endif /* CONFIG_NVMEM */ =20 #define module_nvmem_layout_driver(__layout_driver) \ --=20 2.34.1