@@ -375,7 +375,7 @@ static void dt_resize_property(struct dt_property **prop, size_t len)
(*prop)->list.prev->next = &(*prop)->list;
}
-void pdbg_set_target_property(struct pdbg_target *target, const char *name, const void *val, size_t size)
+void pdbg_target_set_property(struct pdbg_target *target, const char *name, const void *val, size_t size)
{
struct dt_property *p;
@@ -391,7 +391,7 @@ void pdbg_set_target_property(struct pdbg_target *target, const char *name, cons
}
}
-void *pdbg_get_target_property(struct pdbg_target *target, const char *name, size_t *size)
+void *pdbg_target_property(struct pdbg_target *target, const char *name, size_t *size)
{
struct dt_property *p;
@@ -634,7 +634,7 @@ static void dt_expand(const void *fdt)
abort();
}
-u64 dt_get_number(const void *pdata, unsigned int cells)
+static u64 dt_get_number(const void *pdata, unsigned int cells)
{
const u32 *p = pdata;
u64 ret = 0;
@@ -140,12 +140,12 @@ uint64_t pdbg_get_address(struct pdbg_target *target, uint64_t *size)
return dt_get_address(target, 0, size);
}
-int pdbg_get_target_u32_property(struct pdbg_target *target, const char *name, uint32_t *val)
+int pdbg_target_u32_property(struct pdbg_target *target, const char *name, uint32_t *val)
{
uint32_t *p;
size_t size;
- p = pdbg_get_target_property(target, name, &size);
+ p = pdbg_target_property(target, name, &size);
if (!p)
return -1;
@@ -68,13 +68,20 @@ struct pdbg_target *pdbg_target_parent(const char *klass, struct pdbg_target *ta
struct pdbg_target *pdbg_target_require_parent(const char *klass, struct pdbg_target *target);
/* Set the given property. Will automatically add one if one doesn't exist */
-void pdbg_set_target_property(struct pdbg_target *target, const char *name, const void *val, size_t size);
+void pdbg_target_set_property(struct pdbg_target *target, const char *name, const void *val, size_t size);
/* Get the given property and return the size */
-void *pdbg_get_target_property(struct pdbg_target *target, const char *name, size_t *size);
-int pdbg_get_target_u32_property(struct pdbg_target *target, const char *name, uint32_t *val);
+void *pdbg_target_property(struct pdbg_target *target, const char *name, size_t *size);
+int pdbg_target_u32_property(struct pdbg_target *target, const char *name, uint32_t *val);
uint64_t pdbg_get_address(struct pdbg_target *target, uint64_t *size);
+/* Old deprecated for names for the above. Do not use for new projects
+ * as these will be removed at some future point. */
+#define pdbg_set_target_property(target, name, val, size) \
+ pdbg_target_set_property(target, name, val, size)
+#define pdbg_get_target_property(target, name, size) \
+ pdbg_target_property(target, name, size)
+
/* Misc. */
void pdbg_targets_init(void *fdt);
void pdbg_target_probe_all(struct pdbg_target *parent);
@@ -41,7 +41,7 @@ static int xbus_probe(struct pdbg_target *target)
{
struct xbus *xbus = target_to_xbus(target);
- if (pdbg_get_target_u32_property(&xbus->target, "ring-id", &xbus->ring_id)) {
+ if (pdbg_target_u32_property(&xbus->target, "ring-id", &xbus->ring_id)) {
printf("Unknown ring-id on %s@%d\n", pdbg_target_name(&xbus->target),
pdbg_target_index(&xbus->target));
return -1;
@@ -675,7 +675,7 @@ static int target_selection(void)
int proc_index = pdbg_target_index(pib);
if (backend == I2C && device_node)
- pdbg_set_target_property(pib, "bus", device_node, strlen(device_node) + 1);
+ pdbg_target_set_property(pib, "bus", device_node, strlen(device_node) + 1);
if (processorsel[proc_index]) {
target_select(pib);
Some of the functions dealing with target properties have somewhat inconsistent naming. This patch renames them and adds #defines for backwards compatibility for external projects. These will be removed once older projects have moved over to the new names. Signed-off-by: Alistair Popple <alistair@popple.id.au> --- libpdbg/device.c | 6 +++--- libpdbg/libpdbg.c | 4 ++-- libpdbg/libpdbg.h | 13 ++++++++++--- libpdbg/xbus.c | 2 +- src/main.c | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-)