[Pdbg] [PATCH] libpdbg: Add API to get device tree path and find target via path
Alistair Popple
alistair at popple.id.au
Wed Nov 7 15:55:00 AEDT 2018
> > +char *pdbg_target_path(const struct pdbg_target *target)
> > +{
> > + return dt_get_path(target);
> > +}
>
> This is better api than my attempt to add path_target_path(). :-)
:-)
> > +
> > +struct pdbg_target *pdbg_target_find_by_path(struct pdbg_target
> > *target, const char *path)
> > +{
> > + if (!target)
> > + target = dt_root;
> > +
> > + return dt_find_by_path(target, path);
> > +}
> > +
>
> How about pdbg_target_from_path() instead?
I like less typing, good idea. Will change it.
- Alistair
> > void pdbg_set_target_property(struct pdbg_target *target, const char
> >
> > *name, const void *val, size_t size)
> >
> > {
> >
> > struct dt_property *p;
> >
> > diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h
> > index ce11fff..fded62c 100644
> > --- a/libpdbg/libpdbg.h
> > +++ b/libpdbg/libpdbg.h
> > @@ -84,6 +84,8 @@ void pdbg_target_release(struct pdbg_target
> > *target);
> >
> > enum pdbg_target_status pdbg_target_status(struct pdbg_target
> >
> > *target);
> >
> > void pdbg_target_status_set(struct pdbg_target *target, enum
> >
> > pdbg_target_status status);
> >
> > uint32_t pdbg_target_index(struct pdbg_target *target);
> >
> > +char *pdbg_target_path(const struct pdbg_target *target);
> > +struct pdbg_target *pdbg_target_find_by_path(struct pdbg_target
> > *target, const char *path);
> >
> > uint32_t pdbg_parent_index(struct pdbg_target *target, char *klass);
> > char *pdbg_target_class_name(struct pdbg_target *target);
> > char *pdbg_target_name(struct pdbg_target *target);
>
> Amitay.
More information about the Pdbg
mailing list