Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp425547rdb; Thu, 5 Oct 2023 09:43:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHv7Qiv8KswO1QdpaCh+5mqO8PLc4nEX7EifXCEfj9fmfq+nX43EABD4zpJG5ICl0g2WfU0 X-Received: by 2002:a05:6870:3c07:b0:1e5:6286:e513 with SMTP id gk7-20020a0568703c0700b001e56286e513mr1839169oab.8.1696524233116; Thu, 05 Oct 2023 09:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696524233; cv=none; d=google.com; s=arc-20160816; b=wYg8058hCkF5Y6LKggoAu99BQXPJAcfFDsX8bUmRNLtSySiHaT4F8BlNTSRGBB/FKd F8nHNRyv8bMq7U8nccspnlJ8xVF+y3UBlYtiV+xP0S7/ydurW0gwGK4p7YhbtrMgDpix 4RuHT1Lavxr6/wbZn9pmr8Xf89BAA00kKvb/HUb9JcRtBmjbgfPkUV+Aon+BnducJ5J2 hvbsIHCYPzS/ydl/H3MJEEjJhvEbf1mKKOjsSMTpWYOJygacCzYN6WVNy7BM9t7ncVtc SbU3VXQf2tV4Hue74Rw1+B76akA7lX1mtGHvkh6qDOiPqClX7m8pDQUPN6QxSwHX2xUz fiTQ== 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=aGKTwONKSfoZzpn2n3JSkVgAv7XwGFmEAvr55ZBB+Go=; fh=XQzgxiPMj/Cqsom9sWl23DkvcXkGD6r/vx0NuuBn5R0=; b=yhurpvputVY463CaL4siHjyT1HW4ydBF+jtnuv5K9qlahzuYyDDu3DbwNjkCWhqjYq 5kvZeSksoj/+qdBZbOKKoFcfuj8oXHymUT+u7aKtxxCz74b6gur1Gal304Uvb1UTD58u k45Jky5wWSfDhelA7wbwtmXGq0Hc5RPJyQXmZuFqV6wG0jl3neB3ItOUkMS5TYGm9iJG 3p50IykRdWaXPMulDWoiWW7sA5KoHTIbE+rAXgSMxXIDD6T3Ezo8Q5aFqK0hpo6HLSKy 2ztLX9uPYPeeBSJdTeVQmRyLNUHUC9mDEHs9OqoKbHAsqlQUxUGArD+Bb+u05/smzcIF wQJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=kThq2dA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id g123-20020a636b81000000b0057c7341d55bsi1759306pgc.391.2023.10.05.09.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:43:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=kThq2dA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 1655282A2C17; Thu, 5 Oct 2023 09:43:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232531AbjJEQnZ (ORCPT + 99 others); Thu, 5 Oct 2023 12:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234489AbjJEQld (ORCPT ); Thu, 5 Oct 2023 12:41:33 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01D251FC2; Thu, 5 Oct 2023 08:59:17 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id F08F71BF212; Thu, 5 Oct 2023 15:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1696521556; 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=aGKTwONKSfoZzpn2n3JSkVgAv7XwGFmEAvr55ZBB+Go=; b=kThq2dA9mg6lXKkMVJK+SStPNlI+PSaAURbLkfhnE7QiJGX6Fdtn3qEPUp4K48j0lUvhAd w6Zq4TiANeUnV1YI3jWKyP03QGAuAWir3N9sIKN5eJV1Mwn2QgJ7Pof75WvzSh5XJKJOGk LWf0op/24SDiJ7wRbwEgs9FYHJNTTSnWZT0ehK23okOMaUma+2KOKZoRoMjh9S3hFHgJqr QqA4y0Gyht9/MY88Rb6JCJDjj9ZtFyGyjrzXpVH3UR+byy86F6//LuWJ4b95pqW0sWfqhj N2szJGoGyy0ga7cl+9O7nC2nLQaYIR26c++KrDRmH5fw3CzlMpzCm3aYCkZ0Aw== 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 v12 3/7] nvmem: Move of_nvmem_layout_get_container() in another header Date: Thu, 5 Oct 2023 17:59:03 +0200 Message-Id: <20231005155907.2701706-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231005155907.2701706-1-miquel.raynal@bootlin.com> References: <20231005155907.2701706-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED 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 (howler.vger.email [0.0.0.0]); Thu, 05 Oct 2023 09:43:50 -0700 (PDT) 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 286efd3f5a31..c63057a7a3b8 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -844,14 +844,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