Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 577b57fe authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Gerrit - the friendly Code Review server
Browse files

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.

Change-Id: I2dd502cef3583d7fc84b17457096d53640241bb5
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 1852183e142e01cff391b630a7578ff8ddb1a5fa
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarGaurav Kohli <gkohli@codeaurora.org>
parent fd1ab3b4
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -309,15 +309,12 @@ 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)
{