Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2898468rdb; Wed, 4 Oct 2023 15:23:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIP7kiDu/9p9K6r2QN5qxO7paH8QrYWwOYnJ1xRaH1r1lw1xVe+c+8o85IsFXUSeVebkr4 X-Received: by 2002:a17:902:c40d:b0:1c5:de06:9e5a with SMTP id k13-20020a170902c40d00b001c5de069e5amr4019692plk.21.1696458209888; Wed, 04 Oct 2023 15:23:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696458209; cv=none; d=google.com; s=arc-20160816; b=Eqs60mhnzb8ReHY+kKCABi1ZmkYLYAA0J9sEqJnHW0Wann+JylwCiH4ljIU996e+od 6/QaesacqA83JTEpgb1isMSvxnNYKDt3ae2qgdC7iVHnbSyN1vt8WHVuyGXC+240BEXH +JycOjmbgGRRmBW/4a7jwCZ2CLzuE7O+5gCYhJgNjN2yEtf3MsMGPqyfCejJZU+41zKu EWHbnaaE0bt9+FOY09hjrFcFhjZkbfZx6bQspNhYUFF01Ed+5PUoO2SFXKSpCxkLCkfs nxbRWEiFRUIS5p3q3DpBNjNWh4rMOIvPIkZdV0h5ZE3SRkVYhsJUVbNbXOTSnA9LxPN/ nk5g== 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=Gsso1VG1TaOtkSVVCJF5rMb/bS6AWoE0lsnGm4HjbN8=; fh=XQzgxiPMj/Cqsom9sWl23DkvcXkGD6r/vx0NuuBn5R0=; b=pGSR5uHJLb4lcZLjlKIeI0mOHQtJ+Xw/wnI5dBDeeiMpTgNUZ1mDEe1J7E5CSsAMUx IleHuyEIKXsajeQrB8Ukv6mTDRCYBC8f11/KFKB3dZgJztsJT+K6U+zkSalUMDV34W65 nL8ZtS6HO9peGtcOSXGEv+6AlHJ0n3OCQfqDQR+LB+OuAQzaiD7Y8KZFhEqVwj9qxNL7 h9NkTwiTud3lohoiu54dziGcLnoucP0b3qBjrBW9F0DHR725TdZZ89TGZuO0WcaRjNyH 2ugiRHiXtS9FUGF1BBecPCcNiCk65dw6WpWN/9G9XQTNLuQdfL8/dPiQhyW6dVjkLArB cyEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="H/x9tHbL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id kk12-20020a170903070c00b001c4621ac000si117320plb.246.2023.10.04.15.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 15:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="H/x9tHbL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 008E481FD28D; Wed, 4 Oct 2023 15:23:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234617AbjJDWW5 (ORCPT + 99 others); Wed, 4 Oct 2023 18:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233709AbjJDWWx (ORCPT ); Wed, 4 Oct 2023 18:22:53 -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 A9E2EC6; Wed, 4 Oct 2023 15:22:49 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5E7391C0009; Wed, 4 Oct 2023 22:22:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1696458168; 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=Gsso1VG1TaOtkSVVCJF5rMb/bS6AWoE0lsnGm4HjbN8=; b=H/x9tHbLI+7zWMC7ihWzo6QZnyW+b3IX0j/v+z5ek+ReixQc0nq9OPnhURCokEEYyt5bbl MojFzE3gnUlGqjBUXSIeriTcGfg9pwJGolU1twWcNSc+RvM3/O7sBDLctQB/J5iPn/4RDB kGKGoXNVkilXzE8kfB7MMgeN3r4FD+FqFI+OtHu0EqoupxezVybFk2zt7LFYktNTC4WpUa I0/f/ijb1bGu/MQtv2st3yvokJUjzASjIkoKYXaxlMIbhi9u7tDFDejUNjzWZPQfwhjOh9 eiSfq3huHDgCWLxYdA2DlUFl7gjNk8fxI36VXGTCgltZLIq9qZBXvt7szPGMRg== 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 v11 3/7] nvmem: Move of_nvmem_layout_get_container() in another header Date: Thu, 5 Oct 2023 00:22:32 +0200 Message-Id: <20231004222236.411248-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231004222236.411248-1-miquel.raynal@bootlin.com> References: <20231004222236.411248-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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 15:23: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 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..d260738ad03c 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