From patchwork Fri Dec 15 11:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 179181 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9195371dys; Fri, 15 Dec 2023 03:17:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7uIrv7fGYFAtNh5lkN/1aZ4fWu3F0VfWlIYILe8JA23HYlO+1brV5r3dlHuB7WYvnZpXM X-Received: by 2002:a05:6a20:4a27:b0:190:ea14:8cac with SMTP id fr39-20020a056a204a2700b00190ea148cacmr8275234pzb.54.1702639037478; Fri, 15 Dec 2023 03:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702639037; cv=none; d=google.com; s=arc-20160816; b=XgoavQfrE+t/fROCYy3BVgedH6nUpy8WuhDs8YU/qt2eirwdpJfArR2xfxG5n+OwJp aEye8gPdDkxfMfZFMYaENhd/GlsFU/b+clERQX4WxYni6iLzDwQXg1YQ1BYYQAG3AMro IxgWkStqm8PmD8EqqpIkHZe7UJhoi5Ph5yER7xEM9AerFeF53B4BF6yiHkjIjXRpsS1r bSbD/4yN8BUwnCWqZhCzDL1F+ELFMe1q2ir1jr3vPvV2NP9pgcFYJZIuhi9PzJc51j3h UXMKsMQx+EPoFGVfx9LlhU/66d9DrUHsfadHxfR+BEgBEOMFNMAizwQ9A3XYmm3VGtZu w4QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=H3wqcftJe3oQSGEVWIPzNX4f98nIVyBhsOjYp0bmWsA=; fh=ALEjuxmQYbWgig+wIxLy2TTD1IH/EIEdEUBXAEoBMwU=; b=AGwiESM/bOKKA3nacWCEPELQ/ZgUmvWEPALKyXa0qosuKv3azxpUil00hZt9+20Phn hInesRHZ7Kx8xVSN+fN2lLx33RYpLDWGWo5PUZbq4bYfCy92LP+ASObfSlUnyyNj36Y5 BpjIxVn2qb1UVdup7w6DGX+EUNpnQ9SxokZ+87zJI5rviRKRygAh/02KZPVyg16mVSOT 67tkZKKMN/Tzd7ykz8xNlC/1Ealpq9qJbG+xxvFO4jpguqlTKof6OyJwelDo5LpH1Gt1 cUyJE/nWeV/dWl6qBDYGOTT6PmglBIikeNpzND395aKLpQ6o/ALm7mejVb0nsG95lbgi gITQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=daznrApv; spf=pass (google.com: domain of linux-kernel+bounces-811-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-811-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s66-20020a632c45000000b005b881cc9498si13083479pgs.339.2023.12.15.03.17.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 03:17:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-811-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=daznrApv; spf=pass (google.com: domain of linux-kernel+bounces-811-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-811-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 74F95285980 for ; Fri, 15 Dec 2023 11:16:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2C062C685; Fri, 15 Dec 2023 11:15:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="daznrApv" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72A7224A08 for ; Fri, 15 Dec 2023 11:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-336420a244dso384273f8f.0 for ; Fri, 15 Dec 2023 03:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702638948; x=1703243748; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H3wqcftJe3oQSGEVWIPzNX4f98nIVyBhsOjYp0bmWsA=; b=daznrApvU/99RFpf2BiLBAbAY+AREMvYVXsktTBaO84wEaOK42OiLb/2lyHVwDrwNE H16KXtMhZqf7didgKUSiZJIXREeFgZU1Wd20czDA1I9vf0zHXC+Ais+2zs+W5DPksvAm eVMRPyJMin8fNPyaAGJE8mwPQ92gkEewyjl3he4BKjrBixVCiS2PSH6dsQv7+DTnUWgP tnpDvrp6WODP7mU7SlvIuEr5FD2HY2+gz8j6J/Er4Kd+d2PQgtM9y2qOAt5knHEuKBiF HmT8LPJPJfkMxmx2wn5Oydx1oi3e3ngMYompm1F54uCoCSkm4OEo71g02Q0D0nnrW69N 1fcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702638948; x=1703243748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H3wqcftJe3oQSGEVWIPzNX4f98nIVyBhsOjYp0bmWsA=; b=lv5j1ahWdIbWJ8y9xJcNr2ehLqfORU2rnrzJ6BG2s/fX8zSzPGZ0/7KGGDWTFR16Nv wUgEHsO+z7lvl7JCWyNhELuuWXRT2bovpGeyTA0Ce+AlTy/AQ05YvbwJ4FMKd0dVnNf7 ma0XOFun3QGIslfjG/eMJRTN+1FL9myQ2+QGq9uqtrddfi2de9C5Im0uRKrdTS2l9J8K tyDfPwGMgR9EUH/JNeRJD1VIu+YAN7vg31FHMMA4xYFTlFKV1udmwHAGwDKNs2cUQRpt m/mgSkwGZzWAF/6YR0s3pkhxq24qiSYEIjHL49oq6fJFukcJjVwp1IFLhM3MF2xgCFfW A3jw== X-Gm-Message-State: AOJu0YzXdYGHE6W3D7L4xAnwZOCNlDAdPEiOgyEYvsRgMz6EmmVSmaoY Tj2t7h7WnciKGg7/mpE7dLaH/Q== X-Received: by 2002:adf:fc46:0:b0:336:4c4b:d702 with SMTP id e6-20020adffc46000000b003364c4bd702mr1000761wrs.117.1702638947761; Fri, 15 Dec 2023 03:15:47 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id g13-20020a056000118d00b003333d46a9e8sm18511497wrx.56.2023.12.15.03.15.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 03:15:47 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Miquel Raynal , Srinivas Kandagatla Subject: [PATCH 02/10] nvmem: Move of_nvmem_layout_get_container() in another header Date: Fri, 15 Dec 2023 11:15:28 +0000 Message-Id: <20231215111536.316972-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231215111536.316972-1-srinivas.kandagatla@linaro.org> References: <20231215111536.316972-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3451; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=IeHRu31C5pTVzTrxF1sImdme6q++k9V3VWhgQK6Fu00=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBlfDVX4w/9/C2iAEwJzuHX73JYOK4isekL678re sVRq8ZfhYKJATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZXw1VwAKCRB6of1ZxzRV N4HNB/0Q044LJGF6ZBJnoPZ2mzx2v03HbI2RALPuBjoWSsfGXwDzBIbIiuIlp10N9HyRMM/ITEU gmSkpPXY3V9EMvPuMK2NPKv0IMU5qChaPyMAPxxTE06WjkCDvgTjPEdMSGEjz1P83pSQD1iJgh2 ybu8PaLl/XURNMiiWJMBEbyvEHxuurq7XnDQkLHHEAWR2wEVBpegAxBGboNZ+O1C8kiPbay4/ee Oz3nuteNRfRRLalE1rbQM0UqOV7psMGPb8RqdVDhPEwgJY4ukwgBXbG8yLZivdsChZ4QfMqsnxL gczRh/EfIf/w4Z2R5LOTb1FR40EI/fc1kVlnRmQlj8eiBuee X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785346431378240674 X-GMAIL-MSGID: 1785346431378240674 From: Miquel Raynal 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 Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 8 -------- include/linux/nvmem-consumer.h | 7 ------- include/linux/nvmem-provider.h | 21 +++++++++++++++++++++ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 608b352a7d91..b5b6ec8e04bb 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -847,14 +847,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 6ec4b9743e25..2d306fa13b1a 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -247,7 +247,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) @@ -260,12 +259,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 e3930835235b..e5de21516387 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -244,6 +244,27 @@ nvmem_layout_get_match_data(struct nvmem_device *nvmem, #endif /* CONFIG_NVMEM */ +#if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF) + +/** + * 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 /* CONFIG_NVMEM && CONFIG_OF */ + +static inline struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem) +{ + return NULL; +} + +#endif /* CONFIG_NVMEM && CONFIG_OF */ + #define module_nvmem_layout_driver(__layout_driver) \ module_driver(__layout_driver, nvmem_layout_register, \ nvmem_layout_unregister)