Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a function to find a device which starts with a given name #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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