Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp735787rdg; Wed, 11 Oct 2023 04:16:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMo+Gw9MGFxHgYMKtW/0TbjCH02wOc/+CDEL9Chf0rU275ahlTHvONjzzu+57+DMtsG7OY X-Received: by 2002:a05:6870:4710:b0:1d6:61c8:1b2e with SMTP id b16-20020a056870471000b001d661c81b2emr25306801oaq.44.1697022983695; Wed, 11 Oct 2023 04:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697022983; cv=none; d=google.com; s=arc-20160816; b=OzkqOkvgFD86DeYKo3TWnotKJ8TYgyC4GSQIv+huKIjLRuM4OGpq88vNcf9AUmfeqG dSjOwQc2ke7sCUwFCJB3nO9bRsyYtTWho8Sc5rfxZUugtWyq4VcNmh7Ask+Q2wZykV6T n1MWZzsbhERBcJRTZoc1SIcE7Es1dv91iJOItzcQLRm44rRxytYsSA19Y3/NBueusgmZ MDEn5O7ilw3OxOOkKsqXoQnOJr0QpzDELdZW3p008eNqFJpl4sfNr4rP90pdBbc1ejtT ubRMEDc0WzEg6cUXzXEIGAmyYwl0uQua3s9bOg5E48B0+5SzdkXRCLfvJJHtgpBaRGz2 6ZaQ== 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=EWJphzkvsBfSMHYq9wGyiA3n29gzaJOgdTbtajkF/ws=; fh=XQzgxiPMj/Cqsom9sWl23DkvcXkGD6r/vx0NuuBn5R0=; b=pa+i3ZuZ+Zb6hUVev9Ya5yzaCsZ2anBOiypTGf6CHd0VOGhopQJui0kJGGRN1LiKmU 0BWc6CrzRWYLbyHODq+NmUbSinH0KjKHYJ3UYRj1ALkwre94fDUP2I/1qHpqfH/WpwHY 4VNkTLPBZduGJK00b9g/JfYjK+DWsMAmqFG8vHsO6PFgDHJZlfzBhzJH/7iZQqiIEoGw 8ZPw+vIrBFzktZuNUNKjdonGZaWReSxRHchCteDqEMmzyjOX9vNyv07UcSEFP4eSmSv3 HOLjmTvjWdgsciYjxBhblQgxyDB/2JCB4chC3iJspX4YBb8Qo2nt/0HnJIAgyhBx+jmR iiEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="ETQ80/3N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bs188-20020a6328c5000000b0056952b496efsi5441732pgb.366.2023.10.11.04.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:16:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="ETQ80/3N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 0CC188133D2A; Wed, 11 Oct 2023 04:16:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345959AbjJKLPt (ORCPT + 99 others); Wed, 11 Oct 2023 07:15:49 -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: 8bit 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,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:16:21 -0700 (PDT) X-Spam-Level: ** 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_device *nvmem) } #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 *nvmem) { 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 *nvmem); #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 */ #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 *layout); const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem, struct nvmem_layout *layout); +/** + * 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 *nvmem); + #else static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c) @@ -242,6 +252,10 @@ nvmem_layout_get_match_data(struct nvmem_device *nvmem, return NULL; } +static inline struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem) +{ + return NULL; +} #endif /* CONFIG_NVMEM */ #define module_nvmem_layout_driver(__layout_driver) \ -- 2.34.1