summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2018-09-21 15:40:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-28 15:14:53 +0200
commit1852183e142e01cff391b630a7578ff8ddb1a5fa (patch)
tree9c5bccbaa0cc25cc80d0736d58392a6caa51d35c /drivers/nvmem
parentnvmem: remove the name field from struct nvmem_device (diff)
downloadlinux-1852183e142e01cff391b630a7578ff8ddb1a5fa.tar.xz
linux-1852183e142e01cff391b630a7578ff8ddb1a5fa.zip
nvmem: use list_for_each_entry_safe in nvmem_device_remove_all_cells()
Use the provided helper for iterating over list entries without having to use the list_entry() macro. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/core.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 72313a1d215f..0e963d83a099 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -308,14 +308,11 @@ static void nvmem_cell_drop(struct nvmem_cell *cell)
static void nvmem_device_remove_all_cells(const struct nvmem_device *nvmem)
{
- struct nvmem_cell *cell;
- struct list_head *p, *n;
+ struct nvmem_cell *cell, *p;
- list_for_each_safe(p, n, &nvmem_cells) {
- cell = list_entry(p, struct nvmem_cell, node);
+ list_for_each_entry_safe(cell, p, &nvmem_cells, node)
if (cell->nvmem == nvmem)
nvmem_cell_drop(cell);
- }
}
static void nvmem_cell_add(struct nvmem_cell *cell)