Skip to content

Conversation

@Baum55
Copy link

@Baum55 Baum55 commented Apr 9, 2018

Added a function to find a device which starts with a given name.

The Xilinx Vivado and SDK creates a device tree file which contains the base address as a part of the name (e.g. "axi_bram_ctrl@6fff0000").
It is not possible to implement a general search for the base adresse of a device with "three byname(const char *name)" when the base address have to be part of the search string.

Added a function to find a device which starts with a given name.

The Xilinx Vivado and SDK creates a device tree file which contains the base address as a part of the name (e.g. "axi_bram_ctrl@6fff0000").
It is not possible to implement a general search for the base adresse of a device with "three byname(const char *name)" when the base address have to be part of the search string.
Copy link
Owner

@jviki jviki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution, please note the one simple comment and fix it. I'll approve the pull request then.

dtree.h Outdated
* Returns NULL when not found or on error.
* On error sets error state.
*/
struct dtree_dev_t *dtree_startbyname(const char *name);
Copy link
Owner

@jviki jviki Apr 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, just rename the function to something like dtree_byname_prefix to stay consistent with original convention bysomething.

Renamed the function and parameter to stay consistent with the original convention:

Function: dtree_bysomething
Parameter: something
@Baum55
Copy link
Author

Baum55 commented Apr 9, 2018

Thanks for for the advice. It's definitely a better name for the function.

And thank you for the whole lib code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants