[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180828015252.28511-37-robh@kernel.org>
Date: Mon, 27 Aug 2018 20:52:38 -0500
From: Rob Herring <robh@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH] nvmem: Convert to using %pOFn instead of device_node.name
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.
Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Signed-off-by: Rob Herring <robh@...nel.org>
---
drivers/nvmem/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index aa1657831b70..6988ee9f11ba 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -304,6 +304,7 @@ static void nvmem_cell_drop(struct nvmem_cell *cell)
mutex_lock(&nvmem_cells_mutex);
list_del(&cell->node);
mutex_unlock(&nvmem_cells_mutex);
+ kfree(cell->name);
kfree(cell);
}
@@ -879,7 +880,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
cell->nvmem = nvmem;
cell->offset = be32_to_cpup(addr++);
cell->bytes = be32_to_cpup(addr);
- cell->name = cell_np->name;
+ cell->name = kasprintf(GFP_KERNEL, "%pOFn", cell_np);
addr = of_get_property(cell_np, "bits", &len);
if (addr && len == (2 * sizeof(u32))) {
@@ -904,6 +905,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
return cell;
err_sanity:
+ kfree(cell->name);
kfree(cell);
err_mem:
--
2.17.1
Powered by blists - more mailing lists