summaryrefslogtreecommitdiff
path: root/drivers/nvmem/core.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-10-02 23:11:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-15 15:56:15 +0200
commit3c53e2352a9bf87128e7a8ddb69c7543941a3092 (patch)
treeeca24b21361c1b4b4ba9dc2ce178f640f2c6432c /drivers/nvmem/core.c
parent098ec84f1ad2f7b9a4c88bf61fab021ac2876173 (diff)
nvmem: hide unused nvmem_find_cell_by_index function
nvmem_find_cell_by_index() is only called from inside an #ifdef, so we get a build warning without CONFIG_OF: drivers/nvmem/core.c:496:1: error: 'nvmem_find_cell_by_index' defined but not used [-Werror=unused-function] Move it into the same #ifdef as the caller to avoid the warning. Fixes: e888d445ac33 ("nvmem: resolve cells from DT at registration time") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem/core.c')
-rw-r--r--drivers/nvmem/core.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 31ca04d46c1c..9b18ce90f907 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -494,22 +494,6 @@ out:
}
static struct nvmem_cell *
-nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)
-{
- struct nvmem_cell *cell = NULL;
- int i = 0;
-
- mutex_lock(&nvmem_mutex);
- list_for_each_entry(cell, &nvmem->cells, node) {
- if (index == i++)
- break;
- }
- mutex_unlock(&nvmem_mutex);
-
- return cell;
-}
-
-static struct nvmem_cell *
nvmem_find_cell_by_name(struct nvmem_device *nvmem, const char *cell_id)
{
struct nvmem_cell *cell = NULL;
@@ -975,6 +959,22 @@ out:
}
#if IS_ENABLED(CONFIG_OF)
+static struct nvmem_cell *
+nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)
+{
+ struct nvmem_cell *cell = NULL;
+ int i = 0;
+
+ mutex_lock(&nvmem_mutex);
+ list_for_each_entry(cell, &nvmem->cells, node) {
+ if (index == i++)
+ break;
+ }
+ mutex_unlock(&nvmem_mutex);
+
+ return cell;
+}
+
/**
* of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id
*