[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20181003174704.7067-1-srinivas.kandagatla@linaro.org>
Date: Wed, 3 Oct 2018 18:47:04 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, robh@...nel.org,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH] nvmem: Convert to using %pOFn instead of device_node.name
From: Rob Herring <robh@...nel.org>
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>
[srinivas: rebased on top of next]
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.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 cc815bb2eebd..b4c09bc20b67 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -298,6 +298,7 @@ static void nvmem_cell_drop(struct nvmem_cell *cell)
mutex_lock(&nvmem_mutex);
list_del(&cell->node);
mutex_unlock(&nvmem_mutex);
+ kfree(cell->name);
kfree(cell);
}
@@ -547,7 +548,7 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
cell->nvmem = nvmem;
cell->offset = be32_to_cpup(addr++);
cell->bytes = be32_to_cpup(addr);
- cell->name = child->name;
+ cell->name = kasprintf(GFP_KERNEL, "%pOFn", child);
addr = of_get_property(child, "bits", &len);
if (addr && len == (2 * sizeof(u32))) {
@@ -564,6 +565,7 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
dev_err(dev, "cell %s unaligned to nvmem stride %d\n",
cell->name, nvmem->stride);
/* Cells already added will be freed later. */
+ kfree(cell->name);
kfree(cell);
return -EINVAL;
}
--
2.19.0
Powered by blists - more mailing lists