mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-05-03 13:53:48 +00:00
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@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org> [srinivas: rebased on top of next] Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3dac3583bf
commit
badcdff107
1 changed files with 3 additions and 1 deletions
|
@ -298,6 +298,7 @@ static void nvmem_cell_drop(struct nvmem_cell *cell)
|
||||||
mutex_lock(&nvmem_mutex);
|
mutex_lock(&nvmem_mutex);
|
||||||
list_del(&cell->node);
|
list_del(&cell->node);
|
||||||
mutex_unlock(&nvmem_mutex);
|
mutex_unlock(&nvmem_mutex);
|
||||||
|
kfree(cell->name);
|
||||||
kfree(cell);
|
kfree(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,7 +548,7 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
|
||||||
cell->nvmem = nvmem;
|
cell->nvmem = nvmem;
|
||||||
cell->offset = be32_to_cpup(addr++);
|
cell->offset = be32_to_cpup(addr++);
|
||||||
cell->bytes = 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);
|
addr = of_get_property(child, "bits", &len);
|
||||||
if (addr && len == (2 * sizeof(u32))) {
|
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",
|
dev_err(dev, "cell %s unaligned to nvmem stride %d\n",
|
||||||
cell->name, nvmem->stride);
|
cell->name, nvmem->stride);
|
||||||
/* Cells already added will be freed later. */
|
/* Cells already added will be freed later. */
|
||||||
|
kfree(cell->name);
|
||||||
kfree(cell);
|
kfree(cell);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue